Extract specific link in webpage using VBA code

flaviu123

New Member
Joined
Aug 20, 2014
Messages
44
I want to extract this link or to navigate him: https://www.facebook.com/dialog/oau...4207ead384e2319&sdk=php-sdk-3.2.3&scope=email">
<a href=
login_1.png"


with the middle variable (&redirect_uri=http%3A%2F%2Frosms.eu%2Flogin.php&state=0175c9a333b069c3d20f88cbc7547ff0&sdk=php-sdk-3.2.3&amp- is variable)

The source code is:
HTML:
        ****** charset="UTF-8">    ****** name="avgthreatlabs-verification" content="d303d53f466b0a15234033938af74bd333f29734" />         ****** name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0;">        ****** name="description" content="Aplicatie web pentru trimiterea de mesaje gratuite in orice retea natioanala de telefonie. inviare sms gratis in romania -  sende gratis sms i Rumaenien - envoyer des sms gratuit en Roumanie">        Trimite sms gratis in romania vodafone, orange, cosmote, digimobil - send free sms in romania - Senden Sie kostenlose SMS in rumanien - 75    ******** type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js">*********>        body {        margin: 1em 1em;        font-family:Arial, Helvetica, sans-serif;}


a:link,a:visited,a:active{color: gray; font-family: Arial; font-weight: normal; font-style: normal; text-decoration: none; font-size: 14px; }a:hover {color: green; font-family: Arial; font-weight: normal; font-style: normal; text-decoration: underline;  font-size: 14px; }
table {        border-width: thin;        border-spacing: 1px;        border-style: double;        border-color: black;        border-collapse: collapse;        background-color: white;}table th {        border-width: 1px;        padding: 4px;        border-style: inset;        border-color: gray;        background-color: lightgray;        -moz-border-radius: ;}table td {        border-width: 1px;        padding: 4px;        border-style: inset;        border-color: gray;        background-color: white;        -moz-border-radius: ;}
table td:hover {        border-width: 1px;        padding: 4px;        border-style: inset;        border-color: gray;        background-color: lightgreen;        -moz-border-radius: ;}


********>(function(d, s, id) {  var js, fjs = d.getElementsByTagName(s)[0];  if (d.getElementById(id)) return;  js = d.createElement(s); js.id = id;  js.src = "//connect.facebook.net/en_US/all.js#xfbml=1&appId=550967744986985";  fjs.parentNode.insertBefore(js, fjs);}(document, 'script', 'facebook-jssdk'));*********>





@import "menu/menu_style.css";

Trimite mesaje
Contul MeuSetari ContAlerteMesaje TrimiseAutentificare

Opreste SMS

Verifica expeditor
Termeni


Contact

Asigurari RCA







Contul meu
********>(function(d, s, id) {  var js, fjs = d.getElementsByTagName(s)[0];    if (d.getElementById(id)) return;      js = d.createElement(s); js.id = id;        js.src = "//connect.facebook.net/en_US/all.js#xfbml=1&appId=207891222668292";          fjs.parentNode.insertBefore(js, fjs);          }(document, 'script', 'facebook-jssdk'));*********>


******** async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js">*********>********>(adsbygoogle = window.adsbygoogle || []).push({});*********>


********>  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),  m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)  })(window,document,'script','//www.google-analytics.com/analytics.js','ga');
  ga('create', 'UA-47319341-1', 'rosms.eu');  ga('send', 'pageview');
*********>
 

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.
I succeeded with this code:
Code:
Sub test()Dim ie As Object
Dim html As Object
Dim myLinks As Object
Dim myLink As Object
Set ie = New InternetExplorer
ie.Navigate ("http://rosms.eu/login.php")
ie.Visible = False
While ie.ReadyState <> 4
DoEvents
Wend
Set myLinks = ie.Document.All.tags("a")
For Each myLink In myLinks
If InStr(myLink.href, "facebook") Then
ie.Navigate myLink
Do While ie.Busy: DoEvents: Loop
Do Until ie.ReadyState = READYSTATE_COMPLETE: DoEvents: Loop
End If
Next myLink

End Sub
 
Upvote 0

Forum statistics

Threads
1,213,543
Messages
6,114,245
Members
448,555
Latest member
RobertJones1986

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