getting the url string from a dynamic text link

TahorSuiJurisBenYAH

New Member
Joined
Dec 21, 2015
Messages
7
Hello,

How would I be able to extract the URL
HTML:
http://www.koeppelnissan.com
- that is within the below class="rllt__action-button _Jrh" ?

Any and all suggestions, greatly appreciated.

REF:
Dim sDD As String
Dim aDD As Variant
'-------------------------------------------------
'GET WEBSITE - COLUMN 5/E
sDD = Trim(Doc.getElementsByClassName("rllt__action-button _Jrh")(0).outerHTML)
MsgBox sDD

aDD = Split(sDD, ",")
'ActiveSheet.Range("e" & x).Value = aDD(1)
'---------------------------------------------------

'
HTML:
<a class="rllt__action-button _Jrh" href="/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&cad=rja&uact=8&ved=0ahUKEwiQ3P6h_5zKAhUF7A4KHbLnACgQgU8IEzAA&url=http%3A%2F%2Fwww.koeppelnissan.com%2F&usg=AFQjCNGkovFpjdBhADg_eKigryNOkISaTQ" data-ved="0ahUKEwiQ3P6h_5zKAhUF7A4KHbLnACgQgU8IEzAA" onmousedown="return rwt(this,'','','','1','AFQjCNGkovFpjdBhADg_eKigryNOkISaTQ','','0ahUKEwiQ3P6h_5zKAhUF7A4KHbLnACgQgU8IEzAA','','',event)"><div class="_nMg"><span class="_Mrh"></span><div class="_Orh">Website</div></div></a>
 
Last edited by a moderator:

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.
Hi Tahor,

you could use two Instr() functions like so:
Code:
    startUrl = InStr(sDD, "url=")
    endUrl = InStr(sDD, "usg=")

    Debug.Print Mid(sDD , startUrl + 4, endUrl - startUrl - 4)
Hope that helps,
Koen
 
Upvote 0

Forum statistics

Threads
1,215,412
Messages
6,124,761
Members
449,187
Latest member
hermansoa

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top