Skip to content Skip to sidebar Skip to footer

Search On A Webpage Using Python Requests

I want to fetch the html contents of a webpage. I am not sure how to define the search field, I tried the following. from fake_useragent import UserAgent import requests ua = Use

Solution 1:

Can be easily done with selenium like this:

from selenium import webdriver

search_input = '1.1.1.1'

driver = webdriver.Chrome('chromedriver.exe')
driver.get('https://randr.nist.gov/enzyme/Default.aspx')
driver.find_element_by_id('MainBody_txtSrchAutoFill').send_keys(search_input)
driver.find_element_by_id('MainBody_ImgSrch').click()
result_table = driver.find_element_by_id('MainBody_gvSearch')
print(result_table.text)

Post a Comment for "Search On A Webpage Using Python Requests"