Jump to content
UBot Underground

Recommended Posts

Hello, 

 

I'm trying to scrap only the "3006" to a text file. And it could change to more than 4 digits. Possibly 5 digits such as "355356". And  If possible, The Item ID should not be case sensitive.

 

Please help. Thank you!!

 

<br>

 

<b id=\"yui_3_7_2_1_1365476531574_1800\">Se habla espanol!</b>
Brand New White Wood BunkBed Rounded Ends and Stackable!
<br>
Please note: the above is not the actual price.It is for posting purposes only.
<br>
ITEM ID:3006
<br>
<br>
<img border=\"0\" alt=\" photo Coupon50off_zpsa7b32ab320.jpg\" width=\"400\" height=\"400\" id=\"yui_3_7_2_1_1365476531574_1810\"> 
 
Link to post
Share on other sites

Use Regular Expression

 

set(#Email Content, "Hello, I\'m trying to scrap only the \"3006\" to a text file. And it could change to more than 4 digits. Possibly 5 digits such as \"355356\". And If possible, The Item ID should not be case sensitive. Please help. Thank you!! <br> <b id=\\\"yui_3_7_2_1_1365476531574_1800\\\">Se habla espanol!</b> Brand New White Wood BunkBed Rounded Ends and Stackable! <br> Please note: the above is not the actual price.It is for posting purposes only. <br> ITEM ID:3006 <br> <br> <img border=\\\"0\\\" alt=\\\" photo Coupon50off_zpsa7b32ab320.jpg\\\" width=\\\"400\\\" height=\\\"400\\\" id=\\\"yui_3_7_2_1_1365476531574_1810\\\"> ", "Global")
set(#item id, $find regular expression(#Email Content, "ITEM ID:.\{1,\}\\d"), "Global") 
set(#item id, $replace(#item id, "ITEM ID:", $nothing), "Global") 

 

This Works Perfect,

Edited by utsavat
Link to post
Share on other sites
  • 2 weeks later...

Since I haven't had access to your email, I had to put the assumed HTML into a variable, but the regexp for fidning your ID could look like this:

(the REAL HTML compared to the assumed HTML might differ in terms of new lines/line breaks etc)

 

set(#htmlFromPage, "<br>
 
<b id=\\\"yui_3_7_2_1_1365476531574_1800\\\">Se habla espanol!</b>
Brand New White Wood BunkBed Rounded Ends and Stackable!
<br>
Please note: the above is not the actual price.It is for posting purposes only.
<br>
ITEM ID:3006
<br>
<br>
<img border=\\\"0\\\" alt=\\\" photo Coupon50off_zpsa7b32ab320.jpg\\\" width=\\\"400\\\" height=\\\"400\\\" id=\\\"yui_3_7_2_1_1365476531574_1810\\\">", "Global")
set(#id, $find regular expression(#htmlFromPage, "(?<=<br>\\nITEM ID:)[0-9]+(?=\\n<br>\\n<br>\\n<img\\sborder=)"), "Global")

 
Link to post
Share on other sites
  • 2 weeks later...

Just use this regex:

(?<=ITEM\s*ID:\s*)\d+

It works with the HTML you provided:

 

set(#ID, $find regular expression("<br>

 
<b id=\\\"yui_3_7_2_1_1365476531574_1800\\\">Se habla espanol!</b>
Brand New White Wood BunkBed Rounded Ends and Stackable!
<br>
Please note: the above is not the actual price.It is for posting purposes only.
<br>
ITEM ID:3006
<br>
<br>
<img border=\\\"0\\\" alt=\\\" photo Coupon50off_zpsa7b32ab320.jpg\\\" width=\\\"400\\\" height=\\\"400\\\" id=\\\"yui_3_7_2_1_1365476531574_1810\\\"> ", "(?<=ITEM\\s*ID:\\s*)\\d+"), "Global")



Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...