young001
unread,May 29, 2012, 10:15:55 AM5/29/12Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to beautifulsoup
I use bs4 to extract some interesting.
print soup.find('div',id='main2') and return None,but print
soup.find('div',id='container2') return the right thing back,what's
wrong?
the website like:
<div id="container2">
<div id="main2">
<div id="content" ui-rel="prefetchframe" class="x-
prefetchframecontent"><script type="text/javascript">// <![CDATA[
XN.DOM.ready(function(){
announcement_show('notice_system','235971127')
});
function closeNotice(){
announcement_close('235971127','notice_system');
}
function clickNotice(url,openWin){
announcement_click( '235971127' , url , openWin , 'notice_system' );
}
// ]]>
</script>
<div id="notice_system"></div>