MCPcopy Index your code
hub / github.com/Python3WebSpider/ProxyPool / crawl

Function crawl

examples/usage.py:16–24  ·  view source on GitHub ↗

use proxy to crawl page :param url: page url :param proxy: proxy, such as 8.8.8.8:8888 :return: html

(url, proxy)

Source from the content-addressed store, hash-verified

14
15
16def crawl(url, proxy):
17 """
18 use proxy to crawl page
19 :param url: page url
20 :param proxy: proxy, such as 8.8.8.8:8888
21 :return: html
22 """
23 proxies = {'http': 'http://' + proxy}
24 return requests.get(url, proxies=proxies).text
25
26
27def main():

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected