我正在尝试解析
http://mobile.de的结果列表.
首先我尝试使用HTMLParser类,但是我遇到了一个错误:HTMLParser.HTMLParseError:构造中间的EOF.
所以我尝试使用BeautifulSoup 4,这对于非有效网站更好,但< div>我正在搜索无法访问,我无法分辨这是我的错还是网站的错误.
from bs4 import BeautifulSoup
import urllib
import socket
searchurl = "http://suchen.mobile.de/auto/search.html?scopeId=C&isSearchRequest=true&sortOption.sortBy=price.consumerGrossEuro"
f = urllib.urlopen(searchurl)
html = f.read()
soup = BeautifulSoup(html)
for link in soup.find_all("div","listEntry "):
print link
listEntry是< div>随着汽车的结果.但似乎他没有解析< form id =“parkAndCompareVehicle”name =“parkAndCompareVehicle”action =“”>.我找不到汤料中的表格.
故障在哪里?