我在Python中使用seleniumwebdriver在搜索字段中输入一些文本并查找它。我现在想解析这个页面/在上面使用类似beauthoulsoup的东西。但我不知道如何调用结果页。在
目前我的代码:
textinput = open("1.txt", "r").read()
url = "http://www.example.com"
driver = webdriver.Chrome(executable_path='path/chromedriver.exe')
driver.get(url)
sbox = driver.find_element_by_name("a")
sbox.send_keys(textinput)
submit = driver.find_element_by_xpath('//*[@id="maincontent"]/form/input[5]')
submit.click()
单击“提交”按钮后,请使用:
它会自动转到下一页。因此,要解析结果页,只需创建另一个:
^{pr2}$^{3}$
相关问题 更多 >
编程相关推荐