get_addr.py 930 B

1234567891011121314151617181920212223
  1. import re
  2. import requests # 导包
  3. from tqdm import tqdm
  4. url = 'https://docs.qq.com/sheet/DYUx0UGlWR0pKaUJG?tab=BB08J2'
  5. # url = 'https://www.myfakeinfo.com/nationalidno/get-chinataiwan-ic-numberandname.php'
  6. header = {
  7. "User-Agent": "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/"
  8. "537.36 (KHTML, like Gecko) Chrome/78.0.3904.108 Safari/537.36"}
  9. response = requests.get(url, headers=header) # 模拟 get 请求
  10. response.encoding = 'utf-8' # 指定编码
  11. print(response.text)
  12. # fp = open('materials/addr.txt', 'a', encoding='utf-8')
  13. # for i in tqdm(range(0, 10)):
  14. # response = requests.get(url, headers=header) # 模拟 get 请求
  15. # response.encoding = 'utf-8' # 指定编码
  16. # addrs = re.findall('</td><td>[a-z]+</td><td>[0-9]+</td><td>[0-9]+</td><td>(.*?)</td></tr><tr><td>', response.text)
  17. # for addr in addrs:
  18. # fp.write(str(addr).replace(' ', '') + '\n')
  19. # fp.close()