X
X
Xander Milonovsky2022-02-26 03:53:13
JavaScript
Xander Milonovsky, 2022-02-26 03:53:13

How to build a given XPath query for Google Sheets?

Good day. I shoveled a lot of things, but I could not build an IMPORTXML query just before this tag. So that the result in the cell is "Advertising" (if there is a match between the article and the presence of numbers of the article in the class) or "N/A" (if there is no match).

For example, the link:
Klats
It has a tag with the inscription advertising, unless, of course, there is someone in the advertisement right now, if not, you can select any other query. There is an inscription "Advertising" on the card, and this is what cannot be parsed.

I tried many options and actions, the result is "No data to import." Please help me build the correct query. If there is an opportunity and desire, with an explanation of the key points of building a query. Thanks a lot.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Dmitry Uvarov, 2016-04-04
@Milk92

Here the first element is returned that satisfies your criteria, its data-item is equal to one, respectively
alert($(".pagination span").data("item"));

G
Grigory Boev, 2022-02-26
@crilaxes

Import the entire page first
"//*"
and see if that data is there at all . Most likely, it is loaded by a script, and it simply does not exist in the original HTML.
If there is data, throw it here, under the spoiler.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question