Skip to content
Advertisement

Tag: user-agent

How do I pass a user-agent to panda’s pd.read_html()?

some websites automatically decline requests due to lack of user-agent, and it’s a hassle using bs4 to scrape many different types of tables. This issue was resolved before through this code: However urllib2 has been depreciated and urllib3 doesn’t have a build_opener() attribute, and I could not find an equivalent attribute either even though I’m sure it has one. Answer

Advertisement