Results 1 to 5 of 5

Using VBA to find and click a link on a web page then download PDF

Threaded View

  1. #1
    Registered User
    Join Date
    11-06-2019
    Location
    Portland
    MS-Off Ver
    10
    Posts
    4

    Using VBA to find and click a link on a web page then download PDF

    Hey all,

    Nutshell of needs:
    Support with two things 1)code to click a specific link on a website and 2)downloading the PDF on the page it loads.

    As of right now, I can get to the page I want, but I can't seem to write code that will click the link I need. Second, which I have only done a little research on, is now that I'm on the webpage, writing code to download the PDF. Any help is greatly appreciated!!

    Couple notes: The link in my code seems to be only temporary for the session when you first do the search, so you will need to start with the "property search" link below and enter the parcel number as well. This will produce a new unique URL that you will need to replace my link in my code for yours to work. Once you do this you seem to be able to close out and re-use your new link.

    SUPPORT INFO:
    multcoproptax.com/Property-Search
    Parcel Number: R246326

    Thanks all,


    
    Sub ClickLinkDownload()
    
    Dim ie As InternetExplorer
    Dim html As HTMLDocument
    Dim Link As Object
    Dim ElementCol As Object
    
    Set ie = New InternetExplorer
    ie.Visible = True
    
    '***below seems like this is only a temporary link, needs to be updated with the instructions above -- I'm too new to post this link so I just left a note, sorry!***
    ie.navigate "YOUR NEW URL LINK GOES HERE AFTER YOUR FIRST SEARCH"
    
        Do Until ie.readyState = READYSTATE_COMPLETE
            DoEvents
        Loop
    
       ie.document.getElementById("tabBills").Click
       
    
    For Each Link In ie.document.getElementsByTagName("a")
       If Link.href = "2019" Then
           Link.Click
           Exit For
         End If
     Next Link
    
    'CODE FOR DOWNLOADING PDF GOES HERE
    
    Set ie = Nothing
    Application.ScreenUpdating = True
    End Sub
    Last edited by Leith Ross; 11-06-2019 at 07:01 PM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. how to click any link in a website and extracting the new link and text in our excel sheet
    By prahladsingh in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-19-2016, 11:55 AM
  2. VBA: IE.Application - STUCK - How to click on link in Web page?
    By alacey425 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 12-17-2015, 01:22 AM
  3. right click and open link on web page
    By JustinN1 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 12-02-2014, 10:40 AM
  4. Macro to download a file by click a button on internet link
    By NoreenDeasy in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 10-09-2014, 12:19 PM
  5. [SOLVED] How to create a link, to send via email one specific page of a work book with a click??
    By jetlee in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 04-28-2013, 02:32 PM
  6. Click cell, link to a page, filter and sort data
    By spreaderman in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-12-2012, 03:47 AM
  7. [SOLVED] Help with Click link, Find, Paste (Excel to Web back to Excel)
    By Steve in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-07-2005, 04:06 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1