Closed fireicewater closed 2 years ago
rt: 我修改了一下解析的地址,修改get_curr_ip 方法如下
def get_curr_ip(): headers = { 'content-type': 'text/html', 'User-Agent': 'Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:22.0) Gecko/20100101 Firefox/22.0' } resp = requests.get('http://ip.tool.chinaz.com/', headers=headers) soup = BS(resp.content, 'html.parser') return soup.select('.fz24')[0].string
rt: 我修改了一下解析的地址,修改get_curr_ip 方法如下