html - Parse resulting webpage Python Selenium -
i used selenium webdriver in python input text in search field , it. i'd parse page/ use beautifulsoup on it. i'm confused how call resulting page.
my code far:
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()
once have clicked on submit button using:
submit.click()
it automatically goes next page. so, parse resulting page, make another:
whatimlookingfor = driver.find_element_by_id("myid")
submit = driver.find_element_by_xpath('//*[@id="maincontent"]/form/input[5]') # still on first page submit.click() # on second page whatimlookingfor = driver.find_element_by_id("myid")
Comments
Post a Comment