Copy Code code as follows:
#!/usr/bin/env python
#coding: Utf-8
Import Re,sys
Import Urllib
From BS4 import BeautifulSoup
Global R_url
Def hq_url ():
so_url = "http://movie.douban.com/subject_search?search_text="
data = Urllib.urlopen (SO_URL+GJZ). Read ()
r = Re.findall (R ' <a class= "NBG" href= (.) *?) OnClick ', data '
r_url = re.sub (', ', ', r[0])
ymdata = Urllib.urlopen (r_url ). Read ()
soup = BeautifulSoup (ymdata)
wz = Soup (' span ', {' property ': ' V: Summary '})
title = Re.findall (R ' name= "title" Value= "(. *?)" ', Ymdata)
Zy = Re.findall (R ' name= "desc" value= "(. *?)" ', Ymdata '
imdb = Re.findall (R ':</span> <a "(.*?)" Target= ', ymdata)
Shijian = Re.findall (R ' <span property= "V:runtime" content= "109" > (. *?) </span> ', Ymdata)
Print U "IMDB movie Web Link"
Print IMDB
Print u "Watercress movie link"
Print R_url
print ' * ' *70
Print Title[0]
Print Zy[0]
Print "Introduction to Movies"
print ' * ' *70
Print WZ
If __name__== ' __main__ ':
Gjz=raw_input ("Please enter movie name:"). Strip ()
Hq_url ()