Answer the question
In order to leave comments, you need to log in
What is the easiest way to combine two parsers into one in python?
What is the easiest way to do this? There is a parser script using grab in python, but for each site I run each script separately, I would like to combine them all into one. Do I need to use object-oriented programming?
Answer the question
In order to leave comments, you need to log in
More or less like this:
parser1.py
class bar:
def foo(site):
g.go(site)
parser2.py
class foo:
def bar(site):
g.go(site)
parser1+2.py
include parser1
include parser2
p1=parser1()
p2=parser2()
p1.bar.foo('http://site')
p2.foo.bar('http://site')
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question