请高手指点一下,感谢
http://quote.eastmoney.com/f1.html?newcode=1.603190
import requests
import re
import time
# 请求头
headers = {'User-Agent':'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/110.0.0.0 Safari/537.36 Edg/110.0.1587.69'}
if __name__ == '__main__':
urls = ['http://quote.eastmoney.com/f1.html?newcode=0.603190'.format(str(i)) for i in range(0,2)]
for url in urls:
res = requests.get(url,headers=headers)
contents = re.findall('<span class="price_down">(.*?)</span>',res.content.decode('utf-8'),re.S) # (.*?)
print(contents)
time.sleep(1)
print(url)