Copy CodeThe code is 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 ' 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 ':
Shijian = Re.findall (R '(. *?)', ymdata)
Print U "IMDB movie net Link"
Print IMDB
Print u "Watercress movie link"
Print R_url
print ' * ' *70
Print Title[0]
Print Zy[0]
Print "Movie profile"
print ' * ' *70
Print WZ
If __name__== ' __main__ ':
Gjz=raw_input ("Please enter the movie name:"). Strip ()
Hq_url ()