Skip to content
Advertisement

Scrapy get only text ignoring the commented content

I researched but can’t find any answers to my question: I want get the main content, ignoring the commented content, how should I do?

JavaScript

my scrapy spider looks like:

JavaScript

But this codes give me only some nt. plz help, thank you.

Advertisement

Answer

When /text() in XPath or ::text in CSS fails to produce the desired result, I use another library.

to install it.

JavaScript
JavaScript
User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement