- ©«¤l
- 55
- ¥DÃD
- 1
- ºëµØ
- 0
- ¿n¤À
- 81
- ÂI¦W
- 0
- §@·~¨t²Î
- win
- ³nÅ骩¥»
- 10
- ¾\ŪÅv
- 20
- µù¥U®É¶¡
- 2016-5-15
- ³Ì«áµn¿ý
- 2018-11-1
|
¥»©«³Ì«á¥Ñ koshi0413 ©ó 2016-9-18 18:40 ½s¿è
¦^´_ 149# c_c_lai
®t§O¦b©ó User-Agent ¤º®e ·|ÀH¾÷ÅÜ´«¡AÁקK¥Î¦P¤@¸ê°T¤j¶q´£¨úºô¶¡A¤U±¦³win10, iphone, ipad,Linux
¨ä¥¦ªºn¦bºô¤W¦¬¶°¡A¤Ï¥¿´N¬O¬Ý¨ì´N¥á¶i¥h¡AÀH¾÷ªº¶V¦h¶V¦n¡A¦bµu®É¶¡¤j¶q¨úºô¶¡A°e¥X¦Ü¹ï¤è¦øªA¾¹ªº¸ê®Æ¤~¦³©Ò®t§O
¤£¹L³o¥u¬O²Ä¤@¨B¡A¨ä¹ê«nªºÁÙ¬O¦b©ó ip ÀH¾÷ÅÜ´«
À³¥Î¨Ò¡G- import requests
- import random
- hs = ['Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.116 Safari/537.36',
- 'Mozilla/5.0 (iPhone; U; CPU iPhone OS 3_0 like Mac OS X; en-us) AppleWebKit/528.18 (KHTML, like Gecko) Version/4.0 Mobile/7A341 Safari/528.16',
- 'Mozilla/5.0 (Linux; U; Android 4.1.2; zh-tw; GT-I9300 Build/JZO54K) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30',
- 'Mozilla/5.0 (iPad; U; CPU OS 3_2 like Mac OS X; en-us) AppleWebKit/531.21.10 (KHTML, like Gecko) Version/4.0.4 Mobile/7B334b Safari/531.21.10'
- 'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0)']
- headers = {"User-Agent":random.choice(hs)}
- url = '²Ä¤@Óºô¶'
- payload={'download':'csv',
- 'qdate':'105/09/07',
- 'selectType':'ALL'}
- res = requests.post(url, headers=headers, data=payload, stream=True)
- headers2 = {"User-Agent":random.choice(hs)}
- url2 = '²Ä¤GÓºô¶'
- payload2={'download':'csv',
- 'qdate':'105/09/07',
- 'selectType':'ALL'}
- res2 = requests.post(url2, headers=headers2, data=payload2, stream=True)
½Æ»s¥N½X ³æ¯ÂªºÀH¾÷ÅÜ´«¨Ò¡G- import random
- for i in xrange(10):
- hs = ['Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.116 Safari/537.36',
- 'Mozilla/5.0 (iPhone; U; CPU iPhone OS 3_0 like Mac OS X; en-us) AppleWebKit/528.18 (KHTML, like Gecko) Version/4.0 Mobile/7A341 Safari/528.16',
- 'Mozilla/5.0 (Linux; U; Android 4.1.2; zh-tw; GT-I9300 Build/JZO54K) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30',
- 'Mozilla/5.0 (iPad; U; CPU OS 3_2 like Mac OS X; en-us) AppleWebKit/531.21.10 (KHTML, like Gecko) Version/4.0.4 Mobile/7B334b Safari/531.21.10'
- 'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0)']
- headers = {"User-Agent":random.choice(hs)}
- print headers
½Æ»s¥N½X |
|