Jump to content

Pull Data Email LIst


Medic873
 Share

Recommended Posts

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 by Medic873
Link to comment
Share on other sites

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 - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

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.com
Something2@something.com
Something3@something.com

Edited 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

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 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

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

  • Recently Browsing   0 members

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