Python爬虫三大库:Requests、Lxml、BeautifulSoup
#!/usr/bin/python
# -*- coding: utf-8 -*-
#Author: zhaosj
import requests
res = requests.get(
'https://www.xiaozhu.com/'
)
print(res)
#执行后的返回结果:
返回值为:200说明是成功的
若为:400/404则请求网页失败.
Python爬虫三大库:Requests、Lxml、BeautifulSoup
#!/usr/bin/python
# -*- coding: utf-8 -*-
#Author: zhaosj
import requests
res = requests.get(
'https://www.xiaozhu.com/'
)
print(res)
#执行后的返回结果:
返回值为:200说明是成功的
若为:400/404则请求网页失败.