Warm tip: This article is reproduced from stackoverflow.com, please click
scrapy web-scraping xpath

xpath : Get data attribute / value

发布于 2020-04-13 09:39:13

I want to extract from a website some product data with Xpath. Unfortunatly , I don't get it. I am really blocked.

The URL is the following : https://www.fertighaus.de/haeuser/suche/

my xpath in Chrome is at the moment : $x('//*[@id="SearchResultsPage"]/div[2]/div/div[2]/div[4]/div[2]/div1/div1/text()')

this xpath give an array with an element, I need a proper xpath giving me the value of data of this element( price of the house) I circled it in yellow in the picture. I guess it is a small change in this xpath.... If someone could help me, it would be great. I am new with scraping and scrapy and it it bite difficult

Thank you very much in advance

enter image description here

Questioner
Remus 007
Viewed
98
Remus 007 2020-02-17 17:42

My solution was to inspect the all the networking from the JS (request mad by the js ). I discovered an API that I could use very easily :). In my case Splash or Selenium did not help .