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;


But I can find the link in:










How can I get my VBA to click that link?
 

Tegenfeldt

New Member
Joined
Aug 6, 2013
Messages
13
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>
 

John_w

MrExcel MVP
Joined
Oct 15, 2007
Messages
5,999
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.
 

Forum statistics

Threads
1,082,250
Messages
5,364,022
Members
400,774
Latest member
Goldi paul

Some videos you may like

This Week's Hot Topics

  • populate from drop list with multiple tables
    Hi All, i have a drop list that displays data, what i want is when i select one of those from the list to populate text from different tables on...
  • Find list of words from sheet2 in sheet1 before a comma and extract text vba
    Hi Friends, Trying to find the solution on my task. But did not find suitable one to the need. Here is my query and sample file with details...
  • Dynamic Formula entry - VBA code sought
    Hello, really hope one of you experts can help with this - i've spent hours on this and getting no-where. .I have a set of data (more rows than...
  • Listbox Header
    Have a named range called "AccidentsHeader" Within my code I have: [CODE]Private Sub CommandButton1_Click() ListBox1.RowSource =...
  • Complex Heat Map using conditional formatting
    Good day excel world. I have a concern. Below link have a list of countries that carries each country unique data. [URL...
  • Conditional formatting
    Hi good morning, hope you can help me please, I have cells P4:P54 and if this cell is equal to 1 then i want row O to say "Fully Utilised" and to...
Top