未更新页面源。Beauty soup在python_button.click()
之后获取页面源代码,而不是在py_button.click()
之后。我希望在单击dropdown
选项后选择页面源。请帮助我解决这个问题
python_button = driver.find_element_by_css_selector("a[href='/CitingArticles.do?product=WOS&SID=8B2ggJlEbmGqTLqT8Wq&search_mode=CitingArticles&parentProduct=WOS&parentQid=2&parentDoc=1&REFID=57952433&logEventUT=WOS:000231266300001&excludeEventConfig=ExcludeIfFromNonInterProduct']")
python_button.click()
py_button=driver.find_element_by_xpath("//select[@id='selectPageSize_bottom']/option[@value='50']")
py_button.click()
soup=BeautifulSoup(urlopen(driver.current_url), 'lxml')
table = soup.find("div", {"class": "search-results"})
inf=table.find_all("div",{"class": "search-results-content"})
for val in inf:
titles=val.find_all('value')
authors=val.find_all('a')
for title in titles:
if 'lang_id' in str(title):
print(title.get_text())
for author in authors:
if 'title="Find more records by this author"' in str(author):
print(author.get_text()+";")
目前没有回答
相关问题 更多 >
编程相关推荐