I’m brand new to Python and web scraping and cannot figure out what is wrong with my code for the life of me. Is it because I’m scraping just one element and not a list? I’ve checked my XPaths so many times. Right now I’m just trying to scrape the parcel number.
My code:
html = requests.get("https://jeffersonmo-assessor.devnetwedge.com/parcel/view/01401903003039/2023")
doc = lxml.html.fromstring(html.content)
parcel_info = doc.xpath('//div[@class="panel-body collapse in egfjbbgcdd"]')
parcelNumber = parcel_info.xpath('./td[@class="col-xs-6"]/div[@class="inner-value"]/text_content()')
parcelNumber
I tried the code above and received the “AttibuteError: ‘list’ object has no attribute ‘xpath’ message.
New contributor
Jamie Vergano is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.