你知道嗎,為什么我得到這個ID ГосРеестра而不是得到這個 ID ГосРеестра。我知道編碼存在一些問題,因為它是西里爾文。不知道如何解決它。抓取網頁是鏈接我的代碼是:dfo_url = "https://opi.dfo.kz/p/ru/DfoObjects/objects/teaser-view/26730?OptionName=ExtraData"r = requests.get(dfo_url)tree = html.fromstring(r.content)tr_elements = tree.xpath('//tr')#Create empty listcol=[]i=0#For each row, store each first element (header) and an empty listfor t in tr_elements[2]: i+=1 name=t.text_content() print ('%d:"%s"'%(i,name)) col.append((name,[]))
添加回答
舉報
0/150
提交
取消