python basic. download python go to and download python 2.7.8

of 18/18
Python Basic

Post on 05-Jan-2016




13 download

Embed Size (px)


Python Basic

Python BasicDownload python

Go to and download Python 2.7.8Follow steps below1. Search phthon download in google.2. Click Download Python Click run.5. Click next in below screen.

6. Click next .7. Click next , and click finish.Ex1: Reading specific value from web8. Open Python

9 . Go to

10 . Go to

11.Choose File and New File

12. Edit code here

13. Edit below code.

import urllibimport rehtmlfile = urllib.urlopen("")htmltext = = '(.+?)'pattern = re.compile(regex)price = re.findall(pattern, htmltext)print price

After you hit enter you can see the output below.['116.47']

14. Go to and link in chrome -> Block the value to be read and right click on the block-> Click component search -> Then, you can see the screen below. Copy the blocked code below!

15. After coding is overrun program as below: choose run and click Run Module

Code & ouput

Code & output

Ex2: crawling web page(s) with key valueType below for crawlinggoogle

Full code# -*- coding:utf-8 -*-import urllib2url=''html=urllib2.urlopen(url).read()print(html)