really puzzle about bs4 for find() method

20 views
Skip to first unread message

young001

unread,
May 29, 2012, 10:15:55 AM5/29/12
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>
Reply all
Reply to author
Forward
0 new messages