Quantcast
Channel: Active questions tagged selenium - Stack Overflow
Viewing all articles
Browse latest Browse all 99418

Save HTML table to external HTML file from password protected page

$
0
0

I need to pull whole html table from password protected page and save it to external html file.

<table id="tblControlorStatus" class="dataTable" aria-describedby="" style="">

driver=webdriver.Firefox()
driver.get("http://MYURL")

assert "Page title" in driver.title 

username = driver.find_element_by_id("ctl00_ContentPlaceHolder1_Login1_UserName")
username.clear()
username.send_keys("MYUSER")

password = driver.find_element_by_name("ctl00$ContentPlaceHolder1$Login1$Password")
password.clear()
password.send_keys("MYPASS")

driver.find_element_by_name("ctl00$ContentPlaceHolder1$Login1$LoginButton").click()

driver.find_element_by_link_text("MYLINKTEXT").click()

html=driver.page_source
soup=BeautifulSoup(html,'lxml')
div=soup.select_one("table#tblControlorStatus")
table=pd.read_html(str(div), header = 0)
print(table[0])

This only prints values from the table to terminal


Viewing all articles
Browse latest Browse all 99418

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>