MCPcopy Create free account
hub / github.com/injetlee/Python / download_page

Function download_page

douban_movie.py:16–22  ·  view source on GitHub ↗

获取url地址页面内容

(url)

Source from the content-addressed store, hash-verified

14
15
16def download_page(url):
17 """获取url地址页面内容"""
18 headers = {
19 'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.80 Safari/537.36'
20 }
21 data = requests.get(url, headers=headers).content
22 return data
23
24
25def get_li(doc):

Callers 1

mainFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected