[Tutor] String Problem

Mark Lawrence breamoreboy at yahoo.co.uk
Mon Jul 6 10:25:08 CEST 2015


On 06/07/2015 08:44, Crusier wrote:
> Dear All,
>
> I have used the urllib.request and download some of the information from a
> site.
>
> I am currently using Python 3.4. My program is as follows:
>
> import urllib.request
>
> response = urllib.request.urlopen('
> http://www.hkex.com.hk/eng/ddp/Contract_Details.asp?PId=175')
>
> saveFile = open('HKEX.txt','w')
> saveFile.write(str(response.read()))
> saveFile.close()
>
>
>
> And the result is as follows:

[snipped]

>
> Please let me know how to deal with this string. I hope I could put onto a
> table first. Eventually, I am hoping that I can able to put all this
> database. I need some guidance of which area of coding I should look into.
>
> Thank you
> Hank
>

Start here 
https://docs.python.org/3/library/html.parser.html#example-html-parser-application

-- 
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.

Mark Lawrence



More information about the Tutor mailing list