Home > other >  Vscode python print can't show the entire content of the crawl
Vscode python print can't show the entire content of the crawl

Time:03-07

10 x64 Windows, such as on the web site https://bbs.csdn.net/topics/399085965
The Windows in the command prompt (CMD) shown below are all

The code is very simple, about the following:
 # coding=utf-8 
The import requests
Import the random

Ua_list=[" Mozilla/5.0 (iPod, U, CPU iPhone OS 4 _3_2 like Mac OS X; useful - cn) AppleWebKit/533.17.9 (KHTML, like Gecko) Version 5.0.2/Mobile/8 h7 Safari/6533.18.5 ",
"Mozilla/5.0 (iPhone; U; CPU iPhone OS 4 _3_2 like Mac OS X; Useful - cn) AppleWebKit/533.17.9 (KHTML, like Gecko) Version 5.0.2/Mobile/8 h7 Safari/6533.18.5,
""MQQBrowser/25 (Linux; U; 2.3.3. Useful - cn; HTC Desire S Build/GRI40; 480 * 800), "
"Mozilla/5.0 (Linux; U; Android 2.3.3; Useful - cn; HTC_DesireS_S510e Build/GRI40) AppleWebKit/533.1 (KHTML, like Gecko) Version 4.0/533.1/Mobile Safari, "
"Mozilla/5.0 (SymbianOS/9.3; U; Series60/3.2/110.48.125 NokiaE75-1 Profile/Configuration/MIDP 2.1 CLDC 1.1) AppleWebKit/413 (KHTML, like Gecko) Safari/413 ",
"Mozilla/5.0 (the device; U; CPU OS 4 _3_3 like Mac OS X; Useful - cn) AppleWebKit/533.17.9 (KHTML, like Gecko) Mobile/8 j2,
""Mozilla/5.0 (Windows NT 5.2) AppleWebKit/534.30 (KHTML, like Gecko) Chrome/12.0.742.122 Safari/534.30",
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10 _7_2) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/14.0.835.202 Safari/535.1 ",
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10 _7_2) AppleWebKit/534.51.22 (KHTML, like Gecko) Version 5.1.1 Safari/534.51.22,
""Mozilla/5.0 (iPhone; CPU iPhone OS 5 _0 like Mac OS X) AppleWebKit/534.46 (KHTML, like Gecko) Version 5.1/Mobile/9 a5313e Safari/7534.48.3,
""Mozilla/5.0 (iPhone; CPU iPhone OS 5 _0 like Mac OS X) AppleWebKit/534.46 (KHTML, like Gecko) Version 5.1/Mobile/9 a5313e Safari/7534.48.3,
""Mozilla/5.0 (iPhone; CPU iPhone OS 5 _0 like Mac OS X) AppleWebKit/534.46 (KHTML, like Gecko) Version 5.1/Mobile/9 a5313e Safari/7534.48.3,
""Mozilla/5.0 (Windows NT 6.1) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/14.0.835.202 Safari/535.1",
"Mozilla/5.0 (compatible; MSIE 9.0; Windows Phone OS 7.5; Trident/5.0; IEMobile/9.0; SAMSUNG; OMNIA7),
""Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0; XBLWP7; ZuneWP7),
""Mozilla/5.0 (Windows NT 5.2) AppleWebKit/534.30 (KHTML, like Gecko) Chrome/12.0.742.122 Safari/534.30",
"Mozilla/5.0 (Windows NT 5.1; The rv: 5.0) Gecko/20100101 Firefox/5.0 ",
"Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.2; Trident/4.0; The.net CLR 1.1.4322; The.net CLR 2.0.50727; . NET4.0 E; The.net CLR 3.0.4506.2152; The.net CLR 3.5.30729; NET4.0 C), "
"Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.2; The.net CLR 1.1.4322; The.net CLR 2.0.50727; . NET4.0 E; The.net CLR 3.0.4506.2152; The.net CLR 3.5.30729; NET4.0 C), "
"Mozilla/4.0 (compatible; MSIE 60; Windows NT 5.1; SV1; The.net CLR 2.0.50727),
""Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0; SLCC2; The.net CLR 2.0.50727; The.net CLR 3.5.30729; The.net CLR 3.0.30729; Media Center PC 6.0; . NET4.0 C; NET4.0 E) ",
"Opera/9.80 (Windows NT 5.1; U; Useful - cn) Presto/2.9.168 Version/11.50 ",
"Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1),
""Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; The.net CLR 2.0.50727; The.net CLR 3.0.04506.648; The.net CLR 3.5.21022; . NET4.0 E; The.net CLR 3.0.4506.2152; The.net CLR 3.5.30729; NET4.0 C), "
"Mozilla/5.0 (Windows; U; Windows NT 5.1; Useful - CN) AppleWebKit/533.21.1 (KHTML, like Gecko) Version/5.0.5 Safari/533.21.1,
""Mozilla/5.0 (Windows; U; Windows NT 5.1; ) AppleWebKit/534.12 (KHTML, like Gecko) Maxthon 3.0/Safari/534.12 ",
"Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; The.net CLR 2.0.50727; TheWorld) "]
The head={' the user-agent:
Ua_list [random randint (0, 26)]}

If __name__=="__main__ ':
Target='https://bbs.csdn.net/topics/399085965'

The req=requests. Get (=target url, headers=head)
The req. Encoding="utf-8"
Print (the req. Text)

# print (head)
Print (head)
  • Related