只爬了ip
import requests
import parsel
import base64
import re
res = requests.get('http://ip.yqie.com/proxygaoni/index.htm')
res.encoding = 'utf-8'
for i in parsel.Selector(res.text).xpath("//tr/td[2]").extract():
print(base64.b64decode(re.findall(f'window\.atob\("(.*?)"\)', i)[0]).decode())
新增一个lxml的xpath版本
import base64
import re
import requests
from lxml import etree
res = requests.get('http://ip.yqie.com/proxygaoni/index.htm')
res.encoding = 'utf-8'
for i in etree.HTML(res.text).xpath('//tr/td[2]/script'):
print(base64.b64decode(re.findall(f'window\.atob\("(.*?)"\)', i.text)[0]).decode())
就很顶