Click link in a cell in InternetExplorer

Tegenfeldt

New Member
Joined
Aug 6, 2013
Messages
13
I am trying to loop thru all links on all pages of a website to find pages that have links to PDF files. Do you have a code sample for that? If not I think I can figure out that myself.

Now to my real problem;
Some links are in a cell in a table on the webpage, like this:

Code:
<td valign="bottom" style="height:170px;"><DIV class="InnerDiv"><A class="CatalogLink"  href="javascript:firstNodeClick('0:0:0')">Golvbrunnar - plast</A></DIV></td>

I want my VBA to click that link, but I can’t find a way to do this.
What I have so far is:

Code:
Set Browser = New InternetExplorer
Browser.navigate "http://core.purus.se/PurusWeb/common/frameset.aspx?Profile=Sweden&NamedPath=Golvbrunnar"
Set Document = Browser.Document
Set td = Document.getElementsByTagName("a")

When I examine TD it is empty;
url]


But I can find the link in:
url]


url]


url]


url]


url]


How can I get my VBA to click that link?
 

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.
oops! The first code should be
Code:
<td valign="bottom" style="height:170px;"><DIV class="InnerDiv"><A class="CatalogLink"  href="javascript:firstNodeClick('0:0:0')">Golvbrunnar - plast</A></DIV></td>
 
Upvote 0
That web page uses frames (frameset.aspx in the URL is a clue). Therefore change the Set Document statement to:
Code:
Set Document = Browser.document.frames("Main").document
Then you could loop through the Document.Links collection to find each link.
 
Upvote 0

Forum statistics

Threads
1,214,938
Messages
6,122,346
Members
449,080
Latest member
Armadillos

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