Get the App
SLTechnology News&Howtos  ›  Development  › 

How to access python disguised as a browser

Shulou Source: shulou.com Published: 2022-06-01 05:55:13 10月28日 Update

This article will explain in detail how to visit python disguised as a browser. The editor thinks it is very practical, so I share it with you as a reference. I hope you can get something after reading this article.

Masquerade as browser access

Some websites are disgusted with the visit of the crawler, so they all refuse the request. At this point, we need to pretend to be a browser, which can be achieved by modifying the header in the http package:

Headers = {'User-Agent':'Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) Rv:1.9.1.6) Gecko/20091201 Firefox/3.5.6'} req = urllib2.Request (url = 'http://secure.verycd.com/signin/*/http://www.verycd.com/', data = postdata, headers = headers) this is the end of the article on "how to access python disguised as a browser". I hope the above content can be helpful to you, so that you can learn more knowledge. If you think the article is good, please share it for more people to see.

Tags: Browsers browsing articles more crawlers good practical content available through articles knowledge websites references help related Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Redmi Microsoft Huawei Xiaomi Shulou Technology