Jump to content

How to read this text in IE


Recommended Posts

Here is the URL to get to the page with the code as shown in the screenshot https://www.rightmove.co.uk/house-prices/detail.html?country=england&locationIdentifier=POSTCODE^1603593&searchLocation=SW1V+1AA&year=1&referrer=listChangeCriteria

But how do I select the highlighted text, the address?

I've tried variations of the below code but to no avail so far

Local $oClassReturn = $oIE.document.getElementsByClassName("soldList")
If Not IsObj($oClassReturn) Then Exit ConsoleWrite("Error in $oClassReturn" & @CRLF)

Local $oTagReturn = $oClassReturn.Item(0).getElementsByTagName("div")
If Not IsObj($oTagReturn) Then Exit ConsoleWrite("Error in $oTagReturn" & @CRLF)
MsgBox(0, "TEST", $oTagReturn.Item(0))

 

Help.JPG

Link to comment
Share on other sites

#include <ie.au3>
#include <string.au3>
#include <array.au3>
$oIE=_IECreate("https://www.rightmove.co.uk/house-prices/detail.html?country=england&locationIdentifier=POSTCODE%5E1603593&searchLocation=SW1V+1AA&year=1&referrer=listChangeCriteria")
$sText=_IEBodyreadHTML($oIE)
_IEQuit($oIE)
$sResult=_StringBetween($sText,'<div class="soldAddress">','</div>')
;~ _ArrayDisplay($sResult)
ConsoleWrite($sResult[0] & @CRLF)
MsgBox(262144, Default, $sResult[0],0)

or without browser

#include <string.au3>
#include <array.au3>
#include <Inet.au3>
$sText = _INetGetSource("https://www.rightmove.co.uk/house-prices/detail.html?country=england&locationIdentifier=POSTCODE%5E1603593&searchLocation=SW1V+1AA&year=1&referrer=listChangeCriteria")
$sResult = _StringBetween($sText, '<div class="soldAddress">', '</div>')
;~ _ArrayDisplay($sResult)
ConsoleWrite($sResult[0] & @CRLF)
MsgBox(262144, Default, $sResult[0], 0)

 

Edited by Exit

App: Au3toCmd              UDF: _SingleScript()                             

Link to comment
Share on other sites

Or

#include <IE.au3>

Local $oIE = _IECreate("https://www.rightmove.co.uk/house-prices/detail.html?country=england&locationIdentifier=POSTCODE%5E1603593&searchLocation=SW1V+1AA&year=1&referrer=listChangeCriteria")
If IsObj($oIE) Then
    Local $oDivs = _IETagNameGetCollection($oIE, "div")
    If IsObj($oDivs) Then
        For $oDiv In $oDivs
            If $oDiv.ClassName = "soldAddress" Then
                MsgBox(4096, "Sold Addresss", $oDiv.InnerText)
            EndIf
        Next
    EndIf
EndIf

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...