Closed shner-elmo closed 4 months ago
What you do on Chrome does not matter, because Chrome does not work on the raw HTML response, but on the DOM.
I bet there are 2 tables that are the first element of their parent. (//table)[1]
probably does what you want.
What you do on Chrome does not matter, because Chrome does not work on the raw HTML response, but on the DOM.
I don't understand, how is the DOM different from the HTML? because maybe some JS modified it?
If that's the case it's the same thing because the HTML that I opened in Chrome was a local file (file://...) that I saved from a website.
@shner-elmo there are some more caveats, even unrelated to JS; see https://docs.scrapy.org/en/latest/topics/developer-tools.html#caveats-with-inspecting-the-live-browser-dom
Hey so I'm trying to locate a table inside the HTML using an XPath, and its not working well, when I select the first element
[1]
it returns a list of two elements instead of just one (I tested it on chrome and it works correctly there).This is the code that I used to initialize it:
And the bug: