[Tutor] Beautiful Soup

Joel Goldstick joel.goldstick at gmail.com
Tue Sep 29 18:05:07 CEST 2015


On Tue, Sep 29, 2015 at 11:47 AM, Crusier <crusier at gmail.com> wrote:

> Hi
>
> I have recently finished reading "Starting out with Python" and I
> really want to do some web scraping. Please kindly advise where I can
> get more information about BeautifulSoup. It seems that Documentation
> is too hard for me.
>
> Furthermore, I have tried to scrap this site but it seems that there
> is an error (<http.client.HTTPResponse object at 0x02C09F90>). Please
> advise what I should do in order to overcome this.
>
>
> from bs4 import BeautifulSoup
> import urllib.request
>
> HKFile = urllib.request.urlopen("
> https://bochk.etnet.com.hk/content/bochkweb/tc/quote_transaction_daily_history.php?code=2388
> ")
> HKHtml = HKFile.read()
> HKFile.close()
>
> print(HKFile)
>
> Thank you
> Hank
> _______________________________________________
> Tutor maillist  -  Tutor at python.org
> To unsubscribe or change subscription options:
> https://mail.python.org/mailman/listinfo/tutor
>

many people find this package to be easier to use than the built in python
support for reading urls:

http://docs.python-requests.org/en/latest/

-- 
Joel Goldstick
http://joelgoldstick.com


More information about the Tutor mailing list