Jump to content

Recommended Posts

Posted

Hello, I'm trying read some IE page source code lines.

 

simplified source code looks like:

 

<div class=items-grid">

....blah blah blah

<div>  <-start of first name div

<Strong class="Card__name">name</strong>

....blah blah blah

</div>    <-end of first card div

<div>  <-start of 2nd name div

<Strong class="Card__name">name2</strong>

....blah blah blah

</div> <- end of 2nd name div

</div>     <- End of <div class=items-grid">

 

How wound I look in div class=items-grid and search for the Strong class="Card__name" text? 


Not asking for the full script just point me at something that can get me started and I'll be happy.

Posted

Try this.. with strong... and class="Card__name"

#include <IE.au3>
#include <MsgBoxConstants.au3>


$oIE = _IECreate ("http://www.google.com", 0, 0, 1, 0)

$target = ""

$tags = $oIE.document.GetElementsByTagName("div")
For $tag in $tags
$class_value = $tag.GetAttribute("class")
If string($class_value) = "logo-subtext" Then
    $target = $tag
        ConsoleWrite("Tag Found " & $target.outerText&@CRLF)
    ExitLoop

EndIf
Next

_IEQuit ($oIE)

 

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...