企查查获取公司统一社会信用代码

# -*- coding: utf-8 -*-
import requests
from requests.packages import urllib3
from bs4 import BeautifulSoup as bs
urllib3.disable_warnings()



# url = 'https://www.qcc.com/web/search?key=%E5%B0%8F%E7%B1%B3%E5%85%AC%E5%8F%B8'
# # key_words = 'SIG'

# headers = {
#     "Accept":"text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7",

#     "Accept-Language":"en-US,en;q=0.9",
#     "Cookie":"acw_tc=7250b3a116838635101003045e90fed1d85c81f4601b2d9a62fa40782b; QCCSESSID=dbf7055254eff86d8c9a26ccc1; qcc_did=bc88899c-7270-4a45-86b2-3a421744cfb9; UM_distinctid=1880e1895a7116a-0e0fd84da2ee06-26031a51-144000-1880e1895a81123; CNZZDATA1254842228=1344709666-1683863169-%7C1683863169",
#     "Sec-Ch-Ua":'"Google Chrome";v="113", "Chromium";v="113", "Not-A.Brand";v="24"',
#     "Upgrade-Insecure-Requests":'1',
#     "User-Agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.0.0.0 Safari/537.36"
# }

# content = requests.get(url,headers=headers,verify=False).apparent_encoding
# # content.encoding='utf-8'

# print(content.text)


# if content.status_code == 200:
#     print(content.text)
# else:
#     print(content.status_code)


soup = bs(html,'html.parser').text.encode('utf8').decode('utf8').encode('gbk', 'ignore').decode('gbk')
print(soup)



# with open('a.txt','a+',encoding='utf8') as f:
#     f.write(text)

备用网站

https://www.creditchina.gov.cn/xinyongfuwu/tongyishehuixinyongdaimachaxunzhuanlan/shehuixinyongdaimachaxun/index.html?keyword=美世(中国)有限公司