1

The general path of values would like to get are:

#squad1 > tbody > tr > td:nth-child(1) > div.nomobil

And

#squad1 > tbody > tr > td:nth-child(1) > i > div.nomobil

So as they are in the list, I would like to search them all together, the string I could use would be this:

//table[@id="squad1"]/tbody/tr/td[1]//div[@class="nomobil"]/text()

The // makes me able to skip the i that's different, how can I jump in jquery? I honestly didn't find anything related to this.

I'll give a weird example just to make understand better, something I tried was the following:

#squad1 > tbody > tr > td:nth-child(1) >> div.nomobil

I tried putting >> to jump, but logically it didn't work.

On this site (https://www.soccer-rating.com/Ferencvaros-Budapest/1950/), i can get the name of athlets:

enter image description here

And to collect them, it is noticed that some have this i element and others do not.

Digital Farmer
  • 1,705
  • 5
  • 17
  • 67
  • 1
    It's not entirely clear from the question - but it _appears_ that you are trying to use syntax from CSS selectors (for example `>`, meaning "direct child of"). If that is the case, just use a space instead of `>` - for example: `#squad1 > tbody > tr > td a`. The `td a` means any `a` which is a descendant of `td` (i.e. a child, or a grand-child, and so on). See [here](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Selectors#combinators). Otherwise, maybe you can clarify the context in your question. – andrewJames Aug 24 '21 at 18:51
  • Hi @andrewjames I put everything in more details to make it easier! – Digital Farmer Aug 24 '21 at 18:54
  • OK, thanks - but that's not really the context I was looking for. More the code context. But anyway, did you try `td a` instead of `td > a`? – andrewJames Aug 24 '21 at 18:56
  • @andrewjames thanks! the correct way is exactly how you indicated ```#squad1 > tbody > tr > td:nth-child(1) div.nomobil``` - If you want to create an answer with this example I commented, I'll mark it as a solution to my problem. Thanks again! – Digital Farmer Aug 24 '21 at 18:57
  • 1
    I didn't know about this possibility to substitute the ```>``` to blank space for create a jump, thanks a lot! – Digital Farmer Aug 24 '21 at 18:58
  • 1
    This is really a duplicate - see here: [CSS Child vs Descendant selectors](https://stackoverflow.com/questions/1182189/css-child-vs-descendant-selectors) – andrewJames Aug 24 '21 at 18:59
  • 1
    I think it was still a valid question, despite being a dupe. Sometimes if you don't know the terminology ("css selectors", "descendants" and so on) it can be difficult to know how to search for an answer. And if you _do_ know the terminology, the chances are you already know the answer. – andrewJames Aug 24 '21 at 19:05

0 Answers0