How Get Nested element?

  • Автор темы Автор темы Tao Guan
  • Дата начала Дата начала

Tao Guan

Пользователь
Регистрация
24.05.2018
Сообщения
73
Реакции
0
Баллы
6
Hello,
Take a example of code as below:
<div id="{variable}">
<div></div>
<div></div>
<div></div>
</div>
How to get/find the the nestd 2nd div element(stoked red) of div with id="{variable}"?
Thank you very much!
 
Create simple regex. Thats fastest way.
Thank you for quick reply!
But could you help me with regex expression about this html code:
<div class="line-list-dops-item" data-id-template="-71">
<div class="line-list-dops-item__name"></div>
<div class="line-list-dops-item-row">
<div class="line-list-dops-item-row-sections">
<div class="line-list-dops-item-row-sections-block width-50">
<div class="line-list-dops-item-row-sections-block__content" data-first-index="F1m" data-section-id="5006766">
<div class="line-list-dops-item-row-sections-block__left">Han1 (-2.5)</div>
<div class="line-list-dops-item-row-sections-block__right-kf"> 2 </div>
</div>
</div>
<div class="line-list-dops-item-row-sections-block width-50">
<div class="line-list-dops-item-row-sections-block__content" data-first-index="F1m" data-section-id="5006766">
<div class="line-list-dops-item-row-sections-block__left">Han2 (+2.5)</div>
<div class="line-list-dops-item-row-sections-block__right-kf"> 1.81 </div>
</div>
</div>
</div>
</div>
</div>
I want to match <div class="line-list-dops-item-row-sections-block__right-kf"> of the 2nd
<div class="line-list-dops-item-row-sections-block width-50">.How to regex?Thank you so much!!!
 
@Tao Guan Create regex with regex designer and see what value you need. If its second then take second value. :-)
https://zennolab.com/wiki/en:creating-a-regular-expressions?s[]=regex

If You fail make screenshot of regex designer where You try.
Thank your guide.
I am not good at Regex expression.
Could you help me to get rid of this example?
website link is https://m.betcity.net/en/line/soccer/1808/5006766
And how to get the element in the red circle(in the attachment)? Html sourse is as below: ( attribute "data-first-index" and "data-section-id" is variable)
<div class="line-list-dops-item-row-sections-block__content" data-first-index="WXm" data-section-id="5006766">

<div class="line-list-dops-item-row-sections-block__left"> X2 </div>
<!----><div class="line-list-dops-item-row-sections-block__right-kf">
6
</div>

</div>
How to regex match by attribute "data-first-index" and "data-section-id"

Thank you very much
 

Вложения

  • screen.png
    screen.png
    16,1 KB · Просмотры: 362
Thank your guide.
I am not good at Regex expression.
Could you help me to get rid of this example?
website link is https://m.betcity.net/en/line/soccer/1808/5006766
And how to get the element in the red circle(in the attachment)? Html sourse is as below: ( attribute "data-first-index" and "data-section-id" is variable)
<div class="line-list-dops-item-row-sections-block__content" data-first-index="WXm" data-section-id="5006766">

<div class="line-list-dops-item-row-sections-block__left"> X2 </div>
<!----><div class="line-list-dops-item-row-sections-block__right-kf">
6
</div>

</div>
How to regex match by attribute "data-first-index" and "data-section-id"

Thank you very much

Hi.
I'm not interested to spoon feed as I still do not see where You try to get result you need.
I'm totally good with helping though.

I would regex first each block of those.
CMXhToR.png


And then just take one block after another and regex out values itself.
I'm not sure how you want to save those data, so on fast look this is good way.

There is some better ways to do scrapping, but those include some c# developing, so I'm trying to give you solution with zenno default options.
 
Hi.
I'm not interested to spoon feed as I still do not see where You try to get result you need.
I'm totally good with helping though.

I would regex first each block of those.
CMXhToR.png


And then just take one block after another and regex out values itself.
I'm not sure how you want to save those data, so on fast look this is good way.

There is some better ways to do scrapping, but those include some c# developing, so I'm trying to give you solution with zenno default options.
Thank you so much for you patience!!!!
But could you provide any service about this solution, if any, how much, I am going be very interested in it.
 
Hi Lokiys!
I´m interested in learning how to create bots.
I´ve contact you by skype
Could have a look?

Thank you!
 

Кто просматривает тему: (Всего: 0, Пользователи: 0, Гости: 0)