Medic873 Posted February 28, 2014 Share Posted February 28, 2014 (edited) Hello, I run this website obviously it is my name after all medic873.com/email.html has all the data on it But here is my issue I want to pull all the email address and put them into a array. But right now I am using the @ sign to do thing and its dividing it all wired I want this Start[1]="jenifer@gmail.com" Start[2]="hello@cox.net" Here is my current code Thanks a ton $NameGenerator = _INetGetSource('http://www.behindthename.com/random/random.php?number=2&gender=f&surname=&all=no&usage_est=1&usage_lim=1') $Start = _StringBetween($NameGenerator, '<center><p><span class="heavymedium">', '</div>') $Name = _StringBetween ($Start[0], '" class="plain">', '</a>'); Edited February 28, 2014 by Medic873 Link to comment Share on other sites More sharing options...
Danp2 Posted February 28, 2014 Share Posted February 28, 2014 I'm confused... Did you post the wrong code? Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
Medic873 Posted February 28, 2014 Author Share Posted February 28, 2014 No I am the one confused I am trying to use the AT Sign to find all the possible emails in the file so right now I am going between all of them and its messing up my list What function would you use for this? Link to comment Share on other sites More sharing options...
water Posted February 28, 2014 Share Posted February 28, 2014 What Danp2 wants to tell you: In the text you talk about "medic873.com/email.html" but in your code you use "www.behindthename.com" My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
Danp2 Posted February 28, 2014 Share Posted February 28, 2014 Yeah... code doesn't match your description. Perhaps you could use StringRegExp() to extract the desired addresses into an array. Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
Medic873 Posted February 28, 2014 Author Share Posted February 28, 2014 sorry here you go and Im confused about how to use stringregexp $NameGenerator = _INetGetSource('http://www.medic873.com/email.html') $Start = _StringBetween($NameGenerator, '<', '.com') $End = _StringBetween($ _arrayDisplay($Start) Link to comment Share on other sites More sharing options...
jdelaney Posted February 28, 2014 Share Posted February 28, 2014 (edited) Provide an actual example of the node containing the email. I can show you an XMLDOM hack to grab all the emails. $sYourHTML = '<html><body><email id="problem_desc">Something@something.com</email><email id="problem_desc">Something2@something.com</email><email id="problem_desc">Something3@something.com</email></body></html>' $oXML = ObjCreate("Microsoft.XMLDOM") $oXML.loadXML('<?xml version="1.0" encoding="utf-8"?><root>' & $sYourHTML & '</root>' & @CRLF) $oEmails = $oXML.selectNodes("//email") For $oEmail In $oEmails ConsoleWrite($oEmail.text & @CRLF) Next output for the above: Something@something.comSomething2@something.comSomething3@something.com Edited February 28, 2014 by jdelaney IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window. Link to comment Share on other sites More sharing options...
Medic873 Posted February 28, 2014 Author Share Posted February 28, 2014 Hey it looks like that will work but you can you make it out put in an array _arraydisplay ($oEmails) dose not seem to work Link to comment Share on other sites More sharing options...
jdelaney Posted February 28, 2014 Share Posted February 28, 2014 (edited) That's a collection, not an array. You have to loop through it like I've shown. You can then output the data into an array. Or, something like this: #include <array.au3> $sYourHTML = '<html><body><email id="problem_desc">Something@something.com</email><email id="problem_desc">Something2@something.com</email><email id="problem_desc">Something3@something.com</email></body></html>' $oXML = ObjCreate("Microsoft.XMLDOM") $oXML.loadXML('<?xml version="1.0" encoding="utf-8"?><root>' & $sYourHTML & '</root>' & @CRLF) $oEmails = $oXML.selectNodes("//email") If $oEmails.Length>0 Then Local $aArray[$oEmails.Length] Else $aArray="" EndIf For $i = 0 To UBound($aArray)-1 $aArray[$i] = $oEmails.item($i).text Next _ArrayDisplay($aArray) Edited February 28, 2014 by jdelaney IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window. Link to comment Share on other sites More sharing options...
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