Jump to content

Recommended Posts

Posted

I have html tag:

<span class="results">Date: 23<br />12</span>

I want get 23 and 12 please help me code.

I have use StringRegEx but error. Please help me. Thanks you so much.

Posted

If those 2 thing are always the only 2 numbers in the line, you should be able to StringRegExp just like this

#include <Array.au3>

$String = '<span class="results">Date: 23<br />12</span>'
$Result = StringRegExp($String, "\d{2}",3)

_ArrayDisplay($Result)
Posted (edited)

I have code HTML:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

</h4><table width="100%" cellpadding="3" cellspacing="5"><tbody><tr><td><p style="text-align: center" /></td></tr><tr><td class="cell"><table border="0" width="100%" cellpadding="1" cellspacing="1"><tbody><tr><td width="82%"><a class="result-link" href=a.asp">My Name</a><br /><span class="results">Date: 23</span></td><td width="18%" valign="bottom"><div style="text-align: right">

I need get Date: 23 from my html code. Please help me. THanks.

Edited by jackerPro
Posted

Were you asking how to get "23" from that list?

If you were, $Result[0] contains 23, $Result[1] contains 12

Regards,Josh

Posted

I have code HTML:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

</h4><table width="100%" cellpadding="3" cellspacing="5"><tbody><tr><td><p style="text-align: center" /></td></tr><tr><td class="cell"><table border="0" width="100%" cellpadding="1" cellspacing="1"><tbody><tr><td width="82%"><a class="result-link" href=a.asp">My Name</a><br /><span class="results">Date: 23</span></td><td width="18%" valign="bottom"><div style="text-align: right">

I need get Date: 23 from my html code. Please help me. THanks.

Posted (edited)

I have code HTML:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

</h4><table width="100%" cellpadding="3" cellspacing="5"><tbody><tr><td><p style="text-align: center" /></td></tr><tr><td class="cell"><table border="0" width="100%" cellpadding="1" cellspacing="1"><tbody><tr><td width="82%"><a class="result-link" href=a.asp">My Name</a><br /><span class="results">Date: 23</span></td><td width="18%" valign="bottom"><div style="text-align: right">

I need get Date: 23 from my html code. Please help me. THanks.

Can you read?

It just pisses me off when N00Bs can't read, or comprehend what is being said.

Were you asking how to get "23" from that list?

If you were, $Result[0] contains 23, $Result[1] contains 12

Edited by JasonB
Posted (edited)

Here you go, works for me again.... why don't you try running the code before spamming..

#include <Array.au3>

$String = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">'& _
'</h4><table width="100%" cellpadding="3" cellspacing="5"><tbody><tr><td><p style="text-align: center" /></td></tr><tr><td class="cell">'& _
'<table border="0" width="100%" cellpadding="1" cellspacing="1"><tbody><tr><td width="82%"><a class="result-link" href=a.asp">'& _
'My Name</a><br /><span class="results">Date: 23</span></td><td width="18%" valign="bottom"><div style="text-align: right">'
$Result = StringRegExp($String, "Date: \d+",3)

_ArrayDisplay($Result)
Edited by Paulie

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
×
×
  • Create New...