Solved

Webscrape cannot get Document of page

Posted on 2014-09-26
6
162 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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 

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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

A little background as to how I came to I design this code: Around 5 years ago I designed an add-in that formatted Excel files to a corporate standard, applying different cell colours and font type depending on whether the cells contained inputs,…
Citrix XenApp, Internet Explorer 11 set to Enterprise Mode and using central hosted sites.xml file.
This Micro Tutorial demonstrates how to create Excel charts: column, area, line, bar, and scatter charts. Formatting tips are provided as well.
This Micro Tutorial demonstrate the bugs in Microsoft Excel for Mac with Pivot Charts.

757 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now