yoram 0 Posted April 30, 2012 Report Share Posted April 30, 2012 I am trying to scrape data from an html page (code sample below).The data I want to scrape is between two td tags:Starting at : <td align="center" bgcolor="#F3F7F8" >Closing at </td>I need to get the data between those tags. After trying to learn rejex for two days, I didn't succeed to do it.Anyone has any suggestion? Thanks <td align="center" bgcolor="#F3F7F8" > <b><font face="Arial" size="2"> <img border =0 name="DDD" src="../Images/esh.gif" style="cursor: hand;" onClick="MyPopUpWinJV('פרטינעל מומחיות ד\'ר ×Âדלמן בוריס','18204','www.old.health.gov.il');" > </font></b> </td> <td align="right" bgcolor="#F3F7F8" width="105"><font face="Arial" size="2" color="#0000FF">בתוקף </font></td> <td align="right" bgcolor="#F3F7F8" width="80"><font face="Arial" size="2" color="#0000FF">רשיון קבוע </font></td> <td align="right" bgcolor="#F3F7F8"><font face="Arial" size="2" color="#0000FF">03/05/1971</font></td> <td align="right" bgcolor="#F3F7F8"><font face="Arial" size="2" color="#0000FF">תל ×Âביב - יפו</font></td> <td align="right" bgcolor="#F3F7F8"><font face="Arial" size="2" color="#0000FF">1-8755</font></td> <td align="right" bgcolor="#F3F7F8"><font face="Arial" size="2" color="#0000FF">בוריס</font></td> <td align="right" dir=rtl bgcolor="#F3F7F8"><font face="Arial" size="2" color="#0000FF">×Âדלמן</font></td> <td bgcolor="#369CCD" align="center"><font color="#FFFFFF" face="Arial" size="1">55</font></td> </tr> <tr> <td align="center" bgcolor="#F3F7F8" > </td> <td align="right" bgcolor="#F3F7F8" width="105"><font face="Arial" size="2" color="#0000FF">בתוקף </font></td> <td align="right" bgcolor="#F3F7F8" width="80"><font face="Arial" size="2" color="#0000FF">רשיון קבוע </font></td> <td align="right" bgcolor="#F3F7F8"><font face="Arial" size="2" color="#0000FF">30/03/2003</font></td> <td align="right" bgcolor="#F3F7F8"><font face="Arial" size="2" color="#0000FF">תל ×Âביב - יפו</font></td> <td align="right" bgcolor="#F3F7F8"><font face="Arial" size="2" color="#0000FF">1-34977</font></td> <td align="right" bgcolor="#F3F7F8"><font face="Arial" size="2" color="#0000FF">×Âלי×â€Ã—•</font></td> <td align="right" dir=rtl bgcolor="#F3F7F8"><font face="Arial" size="2" color="#0000FF">×Âדלמן</font></td> <td bgcolor="#369CCD" align="center"><font color="#FFFFFF" face="Arial" size="1">56</font></td> </tr> <tr> <td align="center" bgcolor="#F3F7F8" > <b><font face="Arial" size="2"> <img border =0 name="DDD" src="../Images/esh.gif" style="cursor: hand;" onClick="MyPopUpWinJV('פרטינעל מומחיות ד\'ר ×Âדלמן ×Âלי×Âס גברי×Âל ×Âדרי×Âן','86478','www.old.health.gov.il');" > </font></b> </td> Quote Link to post Share on other sites
k1lv9h 76 Posted April 30, 2012 Report Share Posted April 30, 2012 Hi, I know it is not regex. This should work.select-td-data-share.ubot Kevin Quote Link to post Share on other sites
yoram 0 Posted May 1, 2012 Author Report Share Posted May 1, 2012 Hi, I know it is not regex. This should work.select-td-data-share.ubot Kevin Thank you Kevin for your replay, the code you wrote is scraping only part of the code between the tags.and unfortunately its not the part i need (i need the onclick code in brackets, or blank if nothing in this specific cell). MyPopUpWinJV('פרטינעל מומחיות ד\'ר ×Âדלמן בוריס','18204','www.old.health.gov.il') it seems like ubot function (page scrape) has problem scraping this code because all the special characters in it.thats why i thought regex is the solution (hope i am wrong, am i?). Quote Link to post Share on other sites
k1lv9h 76 Posted May 4, 2012 Report Share Posted May 4, 2012 Hi, You could try something like this. I used regex to select onclick. select-td-data-004-share.ubot Kevin Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.