Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Webscrape cannot get Document of page

Posted on 2014-09-26
6
Medium Priority
?
177 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 2000 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
Technology Partners: 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

When you see single cell contains number and text, and you have to get any date out of it seems like cracking our heads.
This article describes a serious pitfall that can happen when deleting shapes using VBA.
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.
This Micro Tutorial will demonstrate how to use a scrolling table in Microsoft Excel using the INDEX function.

971 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