Forum Thread: Python Correct?

Python Correct?

I'm trying to create a program that lets me search certain strings, is this the write setup?

Import urllib.request
import urllib2
import re

htmlcontent = urllib2.urlopen('URL').read()
matches = re.findall('regex of string to find', str1 =);

if len(matches) == 0:
print 'I did not find anything'
else:
print 'The string is in the url'

I don't know Python, I looked the code up for help. Please someone tell me if this is correct, I can't run it right now just wondering. Please and Thanks. :D

2 Responses

Typo, write is suppose to be right...

Share Your Thoughts

  • Hot
  • Active