【发布时间】:2018-07-31 14:15:54
【问题描述】:
我正在使用 Selenium 登录网页并获取网页进行抓取 我能够得到页面。 我已经在 html 中搜索了我想要抓取的表格。 这里是:-
<table cellspacing="0" class=" tablehasmenu table hoverable sensors" id="table_devicesensortable">
这是脚本:-
rawpage=driver.page_source #storing the webpage in variable
souppage=BeautifulSoup(rawpage,'html.parser') #parsing the webpage
tbody=souppage.find('table', attrs={'id':'table_devicesensortable'}) #scrapping
我能够在 souppage 变量中获取已解析的网页。 但无法抓取并存储在 tbody 变量中。
【问题讨论】:
标签: python selenium web-scraping beautifulsoup