import pymysql
from lxml import html
import urllib.request, urllib.error
import ssl
import os
import time
ctx = ssl.create_default_context()
ctx.check_hostname = False
ctx.verify_mode = ssl.CERT_NONE
html1 = urllib.request.urlopen("https://3g.dxy.cn/newh5/view/pneumonia_peopleapp",context=ctx).read()
etree = html.etree
shi = html1.decode("UTF-8")
etree_html = etree.HTML(shi)
content = etree_html.xpath('//*[@id="root"]/div/div[3]/div[4]/div[1]')
print(content)
for each in content:
print(each)
之前能爬出來資料但是現在爬不出來了,但是網頁除了這個框架之外其他地方都能爬,爬出來的列印的結果就是[],之前都是['3']這樣的
uj5u.com熱心網友回復:
我知道了,下載出來的原始碼里面沒有對應的原始碼,服了丁香園這波操作轉載請註明出處,本文鏈接:https://www.uj5u.com/qita/101005.html
下一篇:ssh密鑰檔案傳遞出現報錯
