网址:https://www.rmfysszc.gov.cn/statichtml/rm_obj/108362.shtml
用
请求出的网页解析为
<div id="time1" style="width:100%; height:60px; text-indent:30px; font-size:14px; line-height:60px;color:#2f2f2f;font-family:'SimSun'">
<span id="wen" style="">距开始</span><span id="time" style="margin-left:10px; "></span> <img style="" src="/Images/时钟.png" />
</div>
from selenium import webdriver
import requests
from scrapy.http import HtmlResponse
from scrapy.selector import Selector
headers = {"User-Agent": choice(
[
"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:67.0) Gecko/20100101 Firefox/67.0",
"Mozilla/5.0(Windows;U;WindowsNT6.1;en-us)AppleWebKit/534.50(KHTML,likeGecko)Version/5.1Safari/534.50",
"Mozilla/5.0(Macintosh;IntelMacOSX10_7_0)AppleWebKit/535.11(KHTML,likeGecko)Chrome/78.0.3904.97 Safari/535.11"