INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

Not Getting New Page HTML

Not Getting New Page HTML

(OP)
Hi,

using Excel VBA I am entering information onto a web page, submitting the data but cannot read the results page, the Internet Explorer's document is still holding the original page's html.
I have tried putting 5 second waits, 10 second waits even 1 minute waits after the ready state is OK after the form submit but to no avail.
The results URL contains no info so I cannot navigate there, and I cannot use a POST with the data variables from the input form because a unique reference is required each time ( as part of the POST data).
All required project references have been made

Could somebody point me in the right direction please?

CODE

Sub ParseInternet()
Dim i As Integer
Dim post_code As String
Dim house_num As String
post_code = CStr(Sheet1.Cells(9, 2).Value)
house_num = CStr(Sheet1.Cells(9, 1).Value)
If post_code = "" Then
    MsgBox ("House Name /Number and postcode MUST be entered")
    Exit Sub
End If

Set Site = CreateObject("InternetExplorer.application")

Dim URL As String


URL = "http://landregistry.data.gov.uk/app/ppd"

Site.Navigate URL
While Site.ReadyState <> READYSTATE_COMPLETE: DoEvents: Wend
Application.Wait (Now + TimeValue("0:00:10"))
Site.Visible = True
Site.Document.getElementById("paon").Value = house_num
Site.Document.getElementById("postcode").Value = post_code
Site.Document.forms(0).submit


While Site.ReadyState <> READYSTATE_COMPLETE: DoEvents: Wend
 Application.Wait (Now + TimeValue("0:00:10"))
'''''PREVIOUS PAGE'S HTML STILL IN SITE.DOCUMENT
Set HTMLTD = Site.Document.getElementsByTagName("TD")
For xTD = 0 To HTMLTD.Length - 1

j = Len(Site.Document.getElementsByTagName("TD")(xTD).innerText)

    If j > 0 And j < 20 Then
 
        Sheet1.Cells(9, xTD + 1).Value = Site.Document.getElementsByTagName("TD")(xTD).innerText
        Exit Sub
    End If

Next xTD

End Sub 

RE: Not Getting New Page HTML

Instead of:
[VBA]
...
[\VBA]

use:
[code]
...
[/code]

to format your code.

You don't have to re-post, you can just edit your own post.

Have fun.

---- Andy

There is a great need for a sarcasm font.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close