• 大小: 4KB
    文件类型: .py
    金币: 1
    下载: 0 次
    发布日期: 2021-05-29
  • 语言: Python
  • 标签: python  pacong  

资源简介

天眼查抓取脚本tianyancha.py

资源截图

代码片段和文件信息

#!/usr/bin/env python
# -*- coding:utf-8 -*-

import requests
import json
from urllib.parse import quote_plus
from bs4 import BeautifulSoup

proxies = {“http“:“http://121.69.3.102:8080“}

headers = {“Accept“:“*/*“
            “Accept-Encoding“:“gzip deflate br“
            “Accept-Language“:“zh-CNzh;q=0.9en;q=0.8la;q=0.7“
            “Connection“:“keep-alive“
            “Content-Length“:“105“
            “Cookie“:“TYCID=1a57f6708efa11e7a46507f51ebfe434; uccid=2f5bc995b3789f4456b8faff0d748fa4; ssuid=3923740682; aliyungf_tc=AQAAAGngOTD9ygQAJ3sOfIJmJ/sqKKjz; csrfToken=sfqh56SKRGgnfc6j7hjQr0tm; RTYCID=063b3dc1d32e4b28a98509d15b3c771e; token=e218629bc2974521a3b27909bc5517e1; _utm=bece73188492477e8d98fb6d360d548d; bannerFlag=true; _csrf=u7EjRrhAhpsgeR1vy7YEbQ==; OA=2oQYBGBW5SxGP1Ti+4At0+9CfBdI2YlMDRYCio3TwU4=; _csrf_bk=c40250bcf1ec80475652237012c118ea; Hm_lvt_e92c8d65d92d534b0fc290df538b4758=1510300815151053851815108882481511441821; Hm_lpvt_e92c8d65d92d534b0fc290df538b4758=1511448341“
            “Host“:“www.tianyancha.com“
            “Referer“:“https//www.tianyancha.com“
            “User-Agent“:“Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_1) AppleWebKit/537.36 (KHTML like Gecko) Chrome/62.0.3202.94 Safari/537.36“
            “X-Requested-With“:“xmlHttpRequest“}

jar = requests.cookies.RequestsCookieJar()
jar.set(‘TYCID‘ ‘1a57f6708efa11e7a46507f51ebfe434‘)
jar.set(‘uccid‘ ‘2f5bc995b3789f4456b8faff0d748fa4‘)
jar.set(‘ssuid‘ ‘3923740682‘)
jar.set(‘aliyungf_tc‘ ‘AQAAAGngOTD9ygQAJ3sOfIJmJ/sqKKjz‘)
jar.set(‘csrfToken‘ ‘sfqh56SKRGgnfc6j7hjQr0tm‘)
jar.set(‘RTYCID‘ ‘063b3dc1d32e4b28a98509d15b3c771e‘)
jar.set(‘token‘ ‘e218629bc2974521a3b27909bc5517e1‘)
jar.set(‘_utm‘ ‘4021072336e06c2b5236d8c1e3be699f‘)
jar.set(‘bannerFlag‘ ‘true‘)
jar.set(‘OA‘ ‘2oQYBGBW5SxGP1Ti+4At0+9CfBdI2YlMDRYCio3TwU4=‘)
jar.set(‘_csrf‘ ‘tiN8NkhiWaIOphmeJ/BOAA==‘)
jar.set(‘_csrf_bk‘ ‘febab1665ae21fe7cb326162dba78d24‘)
jar.set(‘Hm_lvt_e92c8d65d92d534b0fc290df538b4758‘ ‘151030081515105385181

评论

共有 条评论