That's because the results of queries are tuples, my bad...
Try this instead:
def start_requests(self):
db = MySQLdb.connect(host="localhost", user="root", passwd="", db=
"crawler_engine", charset = 'utf8', use_unicode = False)
cur = db.cursor()
cur.execute("select url from urls where num_crawl=1")
for url in cur.fetchall():
yield Request(url[0])
On Monday, January 13, 2014 10:41:25 PM UTC+1, d4v1d wrote:
>
> Thanks for your response
> but with this pattern i have the error below on this row
> do you know why ?
>
>
> yield Request(url)
>
> "exceptions.TypeError : Request url must be str or unicode, got tuple"
> thanks in advance
>
>
--
You received this message because you are subscribed to the Google Groups
"scrapy-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/scrapy-users.
For more options, visit https://groups.google.com/groups/opt_out.