Ich brauche Inhalt einer HTML-Seiten, aber wenn eine HTML-Seite ein Iframe-Element enthält, brauche ich iframe Inhalt auch. (in Python) Ist es möglich, alles mit einer Python-Funktion zu laden?Get Iframe Inhalt in Python
2
A
Antwort
3
Versuchen Sie mit BeautifulSoup, die supports iframes out of the box.
-Code-Schnipsel (full code here):
import re
from BeautifulSoup import BeautifulSoup, Comment
...
for iframe in mosoup("iframe"):
mosoup.iframe.extract()
UPDATE: den aktuellen Standort von Code verlinkte (jetzt in Github).
Verwandte Themen
- 1. Inhalt in iFrame einfügen
- 2. Inhalt in iFrame übersetzen
- 3. Lesen von Iframe-Inhalt in Iframe Laden
- 4. CKEditor editierbarer Inhalt in IFrame
- 5. Position iframe Inhalt über allen Inhalt
- 6. jQuery - Script-Tag in einem Iframe nicht die iframe Inhalt
- 7. Fokus auf Iframe-Inhalt setzen
- 8. Rspec-Test für Iframe-Inhalt
- 9. Iframe Inhalt ändern CSS Stil
- 10. iframe Inhalt verschwindet auf Firefox
- 11. Ändern Inhalt der iframe dynamicallly
- 12. Drucken Sie den Iframe-Inhalt
- 13. Inhalt von Textboxplatz in iframe Schicht erhalten
- 14. Wie Iframe Inhalt in Popup div laden?
- 15. Iframe-Inhalt in Opera und Chrome drucken
- 16. java: get html Inhalt
- 17. Get iframe src param aus dem iframe selbst
- 18. Python Selenium wechselt in einen iframe in ein Iframe
- 19. Get-Meta-Tag Inhalt Eigenschaft mit BeautifulSoup und Python
- 20. Dynamische IFrame Inhalt aus dem Strom
- 21. Get iframe src von webview stringByEvaluatingJavaScriptFromString
- 22. get parent.location.url - iframe - von Kind zu Eltern
- 23. wenn sonst Aussage - basierend auf iFrame Inhalt?
- 24. Iframe-Inhalt erhalten, wenn Fehlerdokument angezeigt wird?
- 25. Inhalt von iframe auf keyup erhalten
- 26. Inhalt dynamisch erstellten iframe ist leer
- 27. Erlaube nur iframe Inhalt zu laden
- 28. Get HTML im Iframe mit jQuery
- 29. JQuery UI Dialog iFrame Inhalt leer
- 30. Größe der jQuery-Farbbox für Iframe-Inhalt?
Bitte überprüfen @ Martijn Pieters Antwort auf diese Frage http://stackoverflow.com/questions/23028664/python-beautifulsoup-iframe-document-html-extract. Das kann dir helfen. –