Solved

Webscrape cannot get Document of page

Posted on 2014-09-26
6
169 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
3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

 

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

ScreenConnect 6.0 Free Trial

Check out the updates in one game-changing release, ScreenConnect 6.0, based on partner feedback. New features include a redesigned UI that improves session organization and overall user experience. See the enhancements for yourself!

Question has a verified solution.

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

Do you come here a lot? Are you lazy like me and don't want to go through the "trouble" of having to click your Dock's Safari icon and then having to click your Experts Exchange Favorites bookmark to get here? Well then this article is for you.
Citrix XenApp, Internet Explorer 11 set to Enterprise Mode and using central hosted sites.xml file.
This Micro Tutorial will demonstrate the scrolling table in Microsoft Excel using the INDEX function.
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

770 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