一、requests
如果r.text是乱码,则可以参考:
介绍HTTP协议:
代理服务器:防止爬虫过多拒绝被爬,即隐藏真实ip
get方法最常用
对于爬虫来说,这两个最常用
我写的例子
import requests
r=requests.get(“http://python123.io/ws/demo.html”)
r.text
‘
The demo python introduces several python courses.
\r\nPython is a wonderful general-purpose programming language. You can learn Python from novice to professional by tracking the following courses:\r\nBasic Python and Advanced Python.
\r\n’demo=r.text