samedi 2 juillet 2016

Extracting values from the


<a href="javascript:popUp('http://www.abcd.com/calendar/event.php?calendar=1&amp;category=&amp;event=43221&amp;date=2016-02-22','520','520');" onmouseout="javascript:hideEventDetailsBox();" onmouseover="javascript:eventDetailsBox('&lt;b&gt;Time:&lt;/b&gt; 9:00xa0AM-4:30xa0PM&lt;br /&gt;&lt;b&gt;Title:&lt;/b&gt; Hello!&lt;br /&gt;&lt;b&gt;Location:&lt;/b&gt; Cultural World N Avenue &lt;br /&gt;&lt;b&gt;Description:&lt;/b&gt; abcdefghi');" style="font-family:Tahoma;font-size:small;color:#000000;"> I want to scrap the fields(Time/Title/Description/Location from the above HTML using Beautiful Soup4. I am unable to access these attributes inside "onmouseover". I tried the below : print g_dataItem.contents[5].find_all(onmouseover=True) for tag in g_dataItem.contents[5].findAll(onmouseover=True): print tag['onmouseover'] to get the part. javascript:eventDetailsBox('Time: 9:00 AM-4:30 PMTitle: Hello!Location: Cultural World N AvenueDescription: abcdefghi'); But once I get the above, which is in unicode, I am unable to extract the fields from here. Can somebody help ?

Aucun commentaire:

Enregistrer un commentaire