Jury Posted December 15, 2012 Posted December 15, 2012 (edited) I have searched but can't find anything that works for me - how do I retrieve the text nodes of <span class tags? Here is a canned search to the results I want to capture:http://hudoc.echr.coe.int/sites/eng/Pages/search.aspx#and I want to retrieve each of the text items which are nicely named :<span class="document-link headline" title="Show Document">CASE OF DE SOUZA RIBEIRO v. FRANCE</span><span class="column01">22689/07</span><span class="column03">Judgment (Merits and Just Satisfaction)</span><span class="column04">Court (Grand Chamber)</span><span class="column04">13/12/2012</span><span class="fulltext">Preliminary objection joined to merits and dismissed (Article 34 - Victim) Violation of Article 13+8 - Right to an effective remedy (Article 13 - Effective remedy) (Article 8-2 - Interference Prescribed by law Article 8-1 - Respect for family life Respect for private life Article 8 - Right to respect for private and family life Expulsion) (Brazil) Pecuniary damage - claim dismissed Non-pecuniary damage - award</span>My modified simple script from help seems like it should work for one <span class tag but it doesn't::#include <IE.au3> $oIE = _IECreate ('http://hudoc.echr.coe.int/sites/eng/Pages/search.aspx#') Sleep(3000) $id = _IEGetObjByName ($oIE, "column01") $oText1 = _IEPropertyGet($id, "innertext") MsgBox(0, "Value", $oText1) _IEQuit ($oIE)Here is the sites structure if it helps: Edited December 15, 2012 by Jury
Danp2 Posted December 15, 2012 Posted December 15, 2012 Some error checking would show that your call to _IEGetObjByName is failing. You might want to try something like this:#include <IE.au3> $oIE = _IEAttach('http://hudoc.echr.coe.int/sites/eng/Pages/search.aspx#', "URL") Local $oSpans = _IETagNameGetCollection($oIE, "span") For $oSpan In $oSpans If StringLeft($oSpan.className,6) = 'Column' Then MsgBox(0, "Info", "Class: " & $oSpan.className & " Text: " & $oSpan.innerText) EndIf Next Latest Webdriver UDF Release Webdriver Wiki FAQs
Jury Posted December 16, 2012 Author Posted December 16, 2012 Thanks Adventurer is see this kind of variable $oSpan.classNamein this forum often and wish I could understand it more - I don't see it in the help pages where it would be something like:($oIE, "column01") is any ideas where I could learn more about it? Is it like javascript?
Danp2 Posted December 16, 2012 Posted December 16, 2012 Check out: http://www.w3schools.com/htmldom/dom_intro.asp Latest Webdriver UDF Release Webdriver Wiki FAQs
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now