Python Forum
whats the error in this code in python 3.0 as this is running 2.0 pyhon
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
whats the error in this code in python 3.0 as this is running 2.0 pyhon
#1
my question here

import urllib
import re
urls=[]
i=0
regex='<title>(.+?)</title>'
pattern=re.compile(regex)
while i<len(urls):
   htmlfile=urllib.urlopen(urls[i])
   a=htmlfile.read()
   titles=re.findall(pattern,a)
   print titles
   i=i+1
Reply


Messages In This Thread
whats the error in this code in python 3.0 as this is running 2.0 pyhon - by ekansh - Jul-17-2017, 05:35 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Error after a few minutes of running julio2000 10 7,555 Feb-05-2020, 11:05 PM
Last Post: julio2000
  error when running headless selenium julio2000 2 6,067 Feb-01-2020, 12:41 PM
Last Post: julio2000
  What the difference between python2 and python3 when they running my code. lpangfeic 1 2,519 Nov-19-2019, 04:44 PM
Last Post: Larz60+
  Running flask run produces error. Charles1 1 4,972 Oct-04-2019, 10:38 PM
Last Post: snippsat
  Error when running .py file but not when entering exact same code in CLI Broadsworde 3 3,534 Dec-11-2018, 09:06 AM
Last Post: Broadsworde

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020