Parse a link Using LR

i Switched from OB 1 TO OB 2 im Trying to parse a link from a html source Using a browser

im a noob go easy on me thank you

Ps : dont mind the link

Are there multiple links you want to grab, just asking because it might be easier to used css or xpath for that.

As for your LR, not sure why it didnt grab anything but it would grab too much depending on source.

Here are some links from the page in your img

<a target="_blank" href="http://cookiesandyou.com/">Learn More</a>
<a target="_blank" href="https://forum.openbullet.dev">Open Bullet Forum</a>
<a component="topic/reply/guest" href="/login" class="btn btn-primary">Log in to reply</a>

To get just the url
Left would be - href="
Right would be - "

If there was a specific one, xpath or css would be the way to go.

1 Like

Another thing to look out for is that maybe the link is only in the DOM, so you need a Get DOM block before you try and parse the link from the variable that the block created.

Thanks for your Answers i tried the LR Method Somehow i get a link that i dont want :frowning:
Anyway’s in this case here ,lets say i want thins link so i can send it to captcha Should i use LR because it didnt work (empty parse )

<img alt="" width="45" height="45" src="/user_avatar/discourse.openbullet.dev/ruri/45/16_2.png" class="avatar" 

Let say i only Want /user_avatar/discourse.openbullet.dev/ruri/45/16_2.png
What Should i use and how ( A picture would help a lot or a code )

@Ruri @jrem Help please

In this case you can use this css selector (parse in css mode)

.avatar

and the attribute field will be

src

If there is more than 1 avatar on the page: you can parse them all recursively and then get the exact one you want by using the index on the list.
For example parse to a variable called myList and then you can use

@myList[0]

or in interpolated mode

<myList[0]>

to get the first item of the list.

1 Like
src="https://Captchaexample.jpg" data-refresh-

in here i tried
data
and the attribute field
Src
im i Mistaking ? because i got nothing / Really Sorry to bother you

That’s not how css selectors work, you should learn how to write a CSS selector or right click > Copy > selector on chrome

1 Like

Alright then what should i use here i used LR but nothing :frowning:
Please mate

He told your the CSS Selectors to use

<img alt="" width="45" height="45" src="/user_avatar/discourse.openbullet.dev/ruri/45/16_2.png" class="avatar"

. = class, so .avatar = class=“avatar”. It will find all elements on the page that have class=“avatar”

The next part is asking what “field” you want copied which would be the src

Here is a cheat sheet on how to use CSS selectors, they even have a live tester but if you really dont want to do any learning there are chrome/firefox plugins that will find them for you (better then copying the element → css selector)
https://www.w3schools.com/cssref/css_selectors.asp

2 Likes

So you saying i cant use LR Option Like OB1 ,?

After Learning a bit i find it Thanks all for your Help Guys <3 Thank you so much