styles3000 Posted February 22, 2010 Posted February 22, 2010 (edited) I'm attempting to select text and copy from IE between to tags. To be more specific, the<b> </b> tags. The IE code looks like this..... <p>Subdomain <b>christmas.orp.site11.com</b> has been created.<I'm currently using the _IELinkClickByText function.But is there a _IEGetText function? _IELinkClickByText ($oIE, "Go to CPanel",0) _IELoadWait($oIE) _IEImgClick($oIE,'/images/6_1.gif');Subdomains _IELoadWait($oIE) $oForm = _IEFormGetObjByName ($oIE, "form1",1) _IELoadWait($oIE) $oQuery = _IEFormElementGetObjByName ($oForm, "subdomain") _IEFormElementSetValue ($oQuery, $FirstLine) _IELoadWait($oIE) _IEFormSubmit ($oForm) ;UnREM me to Submit _IELoadWait($oIE) Send("{CTRLDOWN}t{CTRLUP}") ;Is there a _IEGetText function that i can use to go into the IE to get whats between those <b>christmas.orp.site11.com</b> tags, select it, and save as a variable and send it when ever to where ever I want? Edited February 22, 2010 by styles3000
notsure Posted February 22, 2010 Posted February 22, 2010 #include <String.au3> #include <array.au3> #include <IE.au3> local $Array local $oIE = _IEAttach("[YourWindowTitleWhereYouGetThisTextFrom]") local $sHTML = _IEBodyReadHTML($oIE) $array = _StringBetween($sHTML, "<p>Subdomain <b>", "</b>") msgbox(64,"yay", $array[0]) ;remember $array[0] causes an error if the stringbetween is not found. This is how i do it.
styles3000 Posted February 22, 2010 Author Posted February 22, 2010 #include <String.au3> #include <array.au3> #include <IE.au3> local $Array local $oIE = _IEAttach("[YourWindowTitleWhereYouGetThisTextFrom]") local $sHTML = _IEBodyReadHTML($oIE) $array = _StringBetween($sHTML, "<p>Subdomain <b>", "</b>") msgbox(64,"yay", $array[0]) ;remember $array[0] causes an error if the stringbetween is not found. This is how i do it. Thanks notsure, Your a gentleman and a scholar. I'm placing the function that you given me within a GUI. When I do so, I totally forgot that I've already had a _StringBetween function in operation(its already defined) I've been looking around the forum and ran across something like like..... $aArray1 = _StringBetween($sSource, '<a href="', '">description') $aArray2 = _StringBetween($sSource, '.com">', '</a>') Is this a good way to handle 2 StringBetween's? Or do you have a better way? By the way, could I PM or email you to in order to access your wealth of knowlegde?
notsure Posted February 23, 2010 Posted February 23, 2010 (edited) There are alot of ways to do it, also stringinstr in combination with stringmid can get you this far. Sure PM me. When i use stringbetween i almost immediately change my array back to the string it was supposed to be (nonarray), Like this; #include <String.au3> #include <array.au3> #include <IE.au3> local $Array local $oIE = _IEAttach("[YourWindowTitleWhereYouGetThisTextFrom]") local $sHTML = _IEBodyReadHTML($oIE) $array = _StringBetween($sHTML, "<p>Subdomain <b>", "</b>") $array = $array[0] I experienced less errors occur this way. The _Stringbetween function likes to give you errors which make your whole script crash. Edited February 23, 2010 by notsure
styles3000 Posted February 25, 2010 Author Posted February 25, 2010 There are alot of ways to do it, also stringinstr in combination with stringmid can get you this far. Sure PM me. When i use stringbetween i almost immediately change my array back to the string it was supposed to be (nonarray), Like this; #include <String.au3> #include <array.au3> #include <IE.au3> local $Array local $oIE = _IEAttach("[YourWindowTitleWhereYouGetThisTextFrom]") local $sHTML = _IEBodyReadHTML($oIE) $array = _StringBetween($sHTML, "<p>Subdomain <b>", "</b>") $array = $array[0] I experienced less errors occur this way. The _Stringbetween function likes to give you errors which make your whole script crash. I want to send you a pdf of the IE window. I tried attaching it but it was to large. How can I send it to ya? You mentioned I should placed the title here ..... _IEAttach("[YourWindowTitleWhereYouGetThisTextFrom]") All the titles are the same take look....http://members.000webhost.com/login.php. Should it look like this...... _IEAttach("[000webhost.com Members Area - Windows Internet Explorer]") or should it look like this..... _IEAttach("[http://members.000webhost.com/panel/subdomains.php?accountID=3529104&login_hash=HNKEBETM1NAtX2PJ&action=add]")
DaleHohm Posted February 26, 2010 Posted February 26, 2010 Also see example for _IELinkGetCollection Dale Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model Automate input type=file (Related) Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded Better Better? IE.au3 issues with Vista - Workarounds SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead? Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble
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