Solved

Webscrape cannot get Document of page

Posted on 2014-09-26
6
171 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
  • 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
Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 

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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Several part series to implement Internet Explorer 11 Enterprise Mode
This article offers some helpful and general tips for safe browsing and online shopping. It offers simple and manageable procedures that help to ensure the safety of one's personal information and the security of any devices.
This Micro Tutorial will demonstrate the scrolling table in Microsoft Excel using the INDEX function.
This Micro Tutorial demonstrates in Microsoft Excel how to consolidate your marketing data by creating an interactive charts using form controls. This creates cool drop-downs for viewers of your chart to choose from.

861 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