在Python中打印selenium webelement的HTML文本

Kir*_*ran 5 python selenium urllib2 beautifulsoup web-scraping

我在Python中使用Selenium webdriver进行网络抓取项目.

如何打印selenium.WebElement的HTML文本?

我打算用它BeautifulSoup来解析HTML来提取感兴趣的数据.

谢谢

Aco*_*orn 11

无法从中获取原始HTML WebElement.

您可以从浏览器对象获取页面源:browser.page_source.