Skip to main content
Question

CSS Selector

  • August 10, 2023
  • 4 replies
  • 20 views

checcosisani
Contributor
Forum|alt.badge.img+12

Hi

which is the correct css to extratc only the first div

image 

 

this not work

#tabella > tbody > tr:nth-child(-n+30) > td.text-left > div:first-child

 

thx

Francesco

4 replies

ebygomm
Influencer
Forum|alt.badge.img+44
  • Influencer
  • 3427 replies
  • August 10, 2023

Are you looking to extract the first word from that column in each row of the table, i.e. excluding the part in italics and the part in bold?


checcosisani
Contributor
Forum|alt.badge.img+12
  • Author
  • Contributor
  • 66 replies
  • August 10, 2023

Yes


ebygomm
Influencer
Forum|alt.badge.img+44
  • Influencer
  • 3427 replies
  • August 10, 2023

Yes 

I don't think  you can do that through css selector alone. You should be able to select the entire text with .DataText2 and then use some regex in a stringsearcher to grab just the first portion of text

[\w\s\d]+

 


checcosisani
Contributor
Forum|alt.badge.img+12
  • Author
  • Contributor
  • 66 replies
  • August 13, 2023

I don't think  you can do that through css selector alone. You should be able to select the entire text with .DataText2 and then use some regex in a stringsearcher to grab just the first portion of text

[\w\s\d]+

 

Ok 

also in this case isn't possible to extract the part after span ?

image 

article:nth-child(-n+30) > div > div:nth-child(3)> div > p:nth-child(3) > span

 

thx

 

Francesco