+ Reply to Thread
Results 1 to 6 of 6

Error Looping Selenium Web Scraping (pls help)

  1. #1
    Forum Contributor
    Join Date
    01-19-2021
    Location
    Brazil
    MS-Off Ver
    Office 365
    Posts
    263

    Error Looping Selenium Web Scraping (pls help)

    Hi,

    I used to run a code with internet explorer to scrape some ZIP codes from a site, but I'm trying to perform this task in Google Chrome by using Selenium. The code does work when I go step by step, but I get an error when it jumps to the next cell of the loop.
    I'm using 'for each cell in selection' because I only need to scrape a few cells among a dataset. I'm not sure if that could be the issue, but if I could make it work that way it'd be great.

    I added a sheet holding a few ZIP codes and the macro. Does anyone have a clue of what is going wrong?

    Please Login or Register  to view this content.
    PS: The website does not require a refresh to check for another ZIP code, it automatically updates the result whenever there's a change within the input/textbox. I haven't got that far, but I assume I'd have to delete the previous ZIP code before adding the next one, or it might just stack all of them sequently. I tried using .Clear, but nothing happens. I thought maybe I could use .SendKeys with CTRL + A and then Backspace (tried that too, but I guess I did it wrong, coz it didn't work either)
    Attached Files Attached Files
    Last edited by therealdees; 03-08-2022 at 06:21 AM.
    Pedro.

  2. #2
    Forum Contributor
    Join Date
    01-19-2021
    Location
    Brazil
    MS-Off Ver
    Office 365
    Posts
    263

    Re: Error Looping Selenium Web Scraping (pls help)

    Anyone?

  3. #3
    Forum Expert CheeseSandwich's Avatar
    Join Date
    12-22-2021
    Location
    Kent, England
    MS-Off Ver
    365 - 2503
    Posts
    1,485

    Re: Error Looping Selenium Web Scraping (pls help)

    Try the below:

    Please Login or Register  to view this content.
    Hope this helps

  4. #4
    Forum Contributor
    Join Date
    01-19-2021
    Location
    Brazil
    MS-Off Ver
    Office 365
    Posts
    263

    Re: Error Looping Selenium Web Scraping (pls help)

    Hey CheeseSandwich

    It worked perfectly!!! Thank you very very much this will save me so much time

    Can you explain me whats the kernel32 about?

  5. #5
    Forum Expert CheeseSandwich's Avatar
    Join Date
    12-22-2021
    Location
    Kent, England
    MS-Off Ver
    365 - 2503
    Posts
    1,485

    Re: Error Looping Selenium Web Scraping (pls help)

    No problem,

    That line is what allows you to use the Sleep function: Sleep 1000 pauses the code for 1second - Sleep 500 would sleep for 0.5 seconds.

  6. #6
    Forum Contributor
    Join Date
    01-19-2021
    Location
    Brazil
    MS-Off Ver
    Office 365
    Posts
    263

    Re: Error Looping Selenium Web Scraping (pls help)

    Great!! I will take a deeper look into it

    Thanks again <3

+ 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. Web Scraping with Selenium and printing to PDF
    By mdolinger in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-26-2022, 04:08 PM
  2. [SOLVED] Selenium Basic - Does anyone know if you can change user-agent in selenium basic?
    By 0o0o0 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-17-2021, 03:18 AM
  3. [SOLVED] VBA Web Scraping /On Error Goto - RUN-TIME ERROR 91
    By Excel_000 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-21-2020, 05:47 PM
  4. HTML scraping with a help of Selenium
    By ChipsSlave in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-31-2018, 12:12 AM
  5. Looping error while reading in Access VBA code- error 3314
    By mls_newbee in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-14-2018, 03:14 PM
  6. could not get last element while looping through class name (web scraping)
    By shiva_raj in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 03-18-2017, 08:15 PM
  7. [SOLVED] Webpage scraping into Excel - Run-time error '438': Object doesn't support this property..
    By kaseyleigh in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 12-29-2014, 08:15 AM

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