python,not getting full response

前端 未结 2 930
礼貌的吻别
礼貌的吻别 2020-12-21 08:26

when I want to get the page using urllib2, I don\'t get the full page.

here is the code in python:

import urllib2
import urllib
import socket
from bs         


        
2条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-21 08:34

    I had the same problem, I though it was urllib but it was bs4.

    Instead of use

    BeautifulSoup(src)
    

    or

    soup = bs4.BeautifulSoup(html, 'html.parser')
    

    try use

    soup = bs4.BeautifulSoup(html, 'html5lib')
    

提交回复
热议问题