+ Reply to Thread
Results 1 to 5 of 5

Log in to webpage using XMLHTTP and scrape table

  1. #1
    Registered User
    Join Date
    02-24-2016
    Location
    Oslo
    MS-Off Ver
    Office 365
    Posts
    59

    Log in to webpage using XMLHTTP and scrape table

    Hi Guys,

    For a long time I've been working on getting info from webpages using InternetExplorer.Application and navigating through the tables to get what I wont. However, there are plenty of webpages that no longer support internet exporer, so I need to find new ways to extract the data.

    I've been playing around lately with XMLHTTP and startet out by scraping swap-rates (https://seb.se/pow/apps/swaprates/default.aspx) wich isn't password protected. I'm now trying to use the same method (with some minor tweaks) to get information from another table on another website which is password protected. I've been searching to web to find any solution, but I can't find any answers. As far as I can see, I think the problem lies on the log-in.

    Is there any way to tweak my code to fix my problem?

    Se attached code and also part of the HTML code to the login-page.


    Please Login or Register  to view this content.
    Skjermbilde.PNG


    For referance, this is my working code to get the swap-data from SEB.

    Please Login or Register  to view this content.

  2. #2
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Log in to webpage using XMLHTTP and scrape table

    Not much help as we could not see the source page.

    Use "Post", instead of "GET"

    But the most important are the parameters. I can't remember the way or short cut to get them, but there are somewhere within the source code.

    .Open "POST", "https://www.autocheck.co.uk/", False

  3. #3
    Registered User
    Join Date
    02-24-2016
    Location
    Oslo
    MS-Off Ver
    Office 365
    Posts
    59

    Re: Log in to webpage using XMLHTTP and scrape table

    Hi again and thanks for your answer AB33,

    Originally, I tried to use the code underneath to fetch a known element (Sheet1.Range("B5").text) behind the password protected site. Just to test if the "log in" part of the code is working. However, it doesn't seem like I'm getting past the log in. I've tried to post an image of the source code on the log in page but is there any other information you need?

    The page I'm trying to log in to is a portfolio management system which you can only access from the network on my office. However, the problem remains the same for other sites. I've tried to implement to code on another webpage: https://www.nordnet.no/login-next to fetch a table witch contains my stock portfolio. This is one of tyhe webpages that noe longer supports Internet Explorer.


    Please Login or Register  to view this content.

  4. #4
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Log in to webpage using XMLHTTP and scrape table

    Unfortunately, I forget the key combination short cuts to view the HTML pages, not the source inspect code. I have not used them for over two years

    .send "DisplayVrm=123456"

    You should use "Post", not "Get".
    On the HTML page (I forget how to access it now), you see parameters. They are in pairs: Name and value. In your case, the user name and password should have values. For instance, DisplayVrm is the parameter name and value is 123456.
    In my experience, if the site does not display or give you the parameters, you can't access it.

  5. #5
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Log in to webpage using XMLHTTP and scrape table

    Okay! I have V got it . After opening (Right click and then "View page source", hit F12, it takes you to a different pages with menus bars

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. I want to scrape data from a webpage that is a pdf
    By Sluggun in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 09-21-2021, 02:00 PM
  2. Macro to scrape data off webpage
    By chrisellis250 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-11-2017, 04:41 AM
  3. [SOLVED] Scrape page source from webpage
    By abousetta in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 12-22-2016, 05:42 PM
  4. Replies: 0
    Last Post: 11-13-2015, 05:42 AM
  5. Scrape webpage script needs adjustments:)
    By wzshop in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-24-2015, 06:41 AM
  6. Data Scrape from webpage
    By arnoldchadd in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-16-2014, 07:31 AM
  7. Scrape Webpage in Access
    By astradford in forum Access Tables & Databases
    Replies: 0
    Last Post: 07-23-2012, 07:34 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