def ajax_get_video(acp_pid, acp_currpage):
print("ajax_get_video({0}, {1})".format(acp_pid, acp_currpage))
url = 'http://www.fullmatchesandshows.com/wp-admin/admin-ajax.php'
user_agent = 'Mozilla/5.0 (Windows NT 6.1; Win64; x64)'
headers = { 'User-Agent' : user_agent, 'Content-type': 'application/x-www-form-urlencoded; charset=UTF-8', 'X-Requested-With': 'XMLHttpRequest' }
params = urllib.urlencode({'acp_currpage': acp_currpage, 'acp_pid': acp_pid, 'acp_shortcode': 'acp_shortcode', 'action': 'pp_with_ajax'})
req = urllib2.Request(url, params, headers)
con = urllib2.urlopen(req)
content = con.read()
print("content={0}".format(content))
#soup = BeautifulSoup(con.read(), "html.parser")
soup = BeautifulSoup(content, "html.parser")
script = soup.find("script")
if script != None and script.has_attr('data-config'):
url = script['data-config']
return url
return None
评论列表
文章目录