Empty fetching using response.xpath in scrapy shell

https://www.gumtree.com/p/pro., I want to extract the src, of the first picture on this page The xpath expression used is"/ / * [@ id= "image-gallery"] / / li [1] / img/@src", using Firefox, which can be extracted in the console with this xpath, but the response.xpath in scrapy shell returns a null value. I hope the old buddy can help with the guidance. I just recently started to contact reptiles, maybe some places do not know, please give me some advice!

Nov.04,2021

the extraction in the browser is extracted on the rendered page, and the request result in the code is the original response,. You should look at the original response result of the corresponding request in the browser network and extract it according to this result.


Thanks for sharing, it makes me a lot.

Menu