Solved

Webscrape cannot get Document of page

Posted on 2014-09-26
6
175 Views
Last Modified: 2014-09-26
I have been running this program for some time.  I go from one page to another, filling in fields (elements) as I go.  Suddenly it is start to fail when I move to a new page.  The ieDoc item is empty?
I am using VBA in Excel.

Help!

    ieApp.navigate "https://www.overstock.com/myaccount?TID=SIGNIN"
    Do While ieApp.Busy: DoEvents: Loop
    Do Until ieApp.READYSTATE = READYSTATE_COMPLETE: DoEvents: Loop
        
        Set ieDoc = ieApp.document

Open in new window

0
Comment
Question by:rrhandle8
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
6 Comments
 
LVL 58

Accepted Solution

by:
Gary earned 500 total points
ID: 40346565
What's the error?
Maybe they have changed the username/password field names
0
 

Author Comment

by:rrhandle8
ID: 40346581
Run time error 424
object required
I get the productnum with this line: ProductNum = Func.GetProductNum(ieDoc.DocumentElement.innerHTML)
That works.
Then I try to set an element using this line:
ieDoc.getElementById(ElementID).Value = OptionNum
The element does exist.  It has been running fine till this morning.
0
 

Author Comment

by:rrhandle8
ID: 40346588
Notice in the code below I error out on the product number, but the quantity gets set.

                ''''''''''''''''''''''''''''''''''
                ' Set Options
                ''''''''''''''''''''''''''''''''''
                ElementID = "addid" & ProductNum
                ieDoc.getElementById(ElementID).Value = OptionNum
                Stop
                ''''''''''''''''''''''''''''''''''
                ' Set Quantity
                ''''''''''''''''''''''''''''''''''
                ElementID = "addqty" & ProductNum
                ieDoc.getElementById(ElementID).Value = 3 'varAmazonOrders(r, OrderFields.quantity_purchased)

Open in new window

0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:rrhandle8
ID: 40346591
Here is the line in the html:

    <input name="addid35432" class="isPrimarytrue" value="57169" type="hidden">
0
 

Author Comment

by:rrhandle8
ID: 40346592
Oops! that has change from ID to Name.  No wonder it errors out.
0
 

Author Closing Comment

by:rrhandle8
ID: 40346632
Well it wasn't those field, but you sent me in the right direction Gary.  Thank You.
0

Featured Post

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This code takes an Excel list of URL’s and adds a header titled “URL List”. It then searches through all URL’s in column “A”, looking for duplicates. When a duplicate is found, it is moved to the top of the list. The duplicate URL’s are then highlig…
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
This Micro Tutorial will demonstrate in Google Sheets how to use the HYPERLINK function to create live links inside your spreadsheet.
This Micro Tutorial will demonstrate how to use a scrolling table in Microsoft Excel using the INDEX function.

632 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question