# -*- coding: utf-8 -*-
import scrapy,re
from baiduserp.items import BaiduserpItem
from baiduserp.executemysql import ExecuteMysql

class BaiduSerp(scrapy.Spider):
	name = "baiduserp"

	def __init__(self,*args, **kwargs):
		super().__init__(*args, **kwargs)
		# ExecuteMysql().create_table()
		self.read_sqldata = ExecuteMysql().get_keydata()
	
	def start_requests(self):
		for urls in self.read_sqldata:
			url = "http://www.baidu.com/s?wd={0}&rn=10".format(urls[1])
			yield scrapy.Request(url=url, meta={'item': urls[0],'title':urls[1]},callback=self.parse)
			
	def parse(self, response):
		item = BaiduserpItem()
		item['id'] = response.meta['item']
		item['bodys'] = response
		return item
	
47e949a1f50d990386848601b785fdeacc887c70
<mask token>


class BaiduSerp(scrapy.Spider):
    <mask token>

    def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)
        self.read_sqldata = ExecuteMysql().get_keydata()
    <mask token>

    def parse(self, response):
        item = BaiduserpItem()
        item['id'] = response.meta['item']
        item['bodys'] = response
        return item

<mask token>


class BaiduSerp(scrapy.Spider):
    <mask token>

    def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)
        self.read_sqldata = ExecuteMysql().get_keydata()

    def start_requests(self):
        for urls in self.read_sqldata:
            url = 'http://www.baidu.com/s?wd={0}&rn=10'.format(urls[1])
            yield scrapy.Request(url=url, meta={'item': urls[0], 'title':
                urls[1]}, callback=self.parse)

    def parse(self, response):
        item = BaiduserpItem()
        item['id'] = response.meta['item']
        item['bodys'] = response
        return item

<mask token>


class BaiduSerp(scrapy.Spider):
    name = 'baiduserp'

    def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)
        self.read_sqldata = ExecuteMysql().get_keydata()

    def start_requests(self):
        for urls in self.read_sqldata:
            url = 'http://www.baidu.com/s?wd={0}&rn=10'.format(urls[1])
            yield scrapy.Request(url=url, meta={'item': urls[0], 'title':
                urls[1]}, callback=self.parse)

    def parse(self, response):
        item = BaiduserpItem()
        item['id'] = response.meta['item']
        item['bodys'] = response
        return item

import scrapy, re
from baiduserp.items import BaiduserpItem
from baiduserp.executemysql import ExecuteMysql


class BaiduSerp(scrapy.Spider):
    name = 'baiduserp'

    def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)
        self.read_sqldata = ExecuteMysql().get_keydata()

    def start_requests(self):
        for urls in self.read_sqldata:
            url = 'http://www.baidu.com/s?wd={0}&rn=10'.format(urls[1])
            yield scrapy.Request(url=url, meta={'item': urls[0], 'title':
                urls[1]}, callback=self.parse)

    def parse(self, response):
        item = BaiduserpItem()
        item['id'] = response.meta['item']
        item['bodys'] = response
        return item

# -*- coding: utf-8 -*-
import scrapy,re
from baiduserp.items import BaiduserpItem
from baiduserp.executemysql import ExecuteMysql

class BaiduSerp(scrapy.Spider):
	name = "baiduserp"

	def __init__(self,*args, **kwargs):
		super().__init__(*args, **kwargs)
		# ExecuteMysql().create_table()
		self.read_sqldata = ExecuteMysql().get_keydata()
	
	def start_requests(self):
		for urls in self.read_sqldata:
			url = "http://www.baidu.com/s?wd={0}&rn=10".format(urls[1])
			yield scrapy.Request(url=url, meta={'item': urls[0],'title':urls[1]},callback=self.parse)
			
	def parse(self, response):
		item = BaiduserpItem()
		item['id'] = response.meta['item']
		item['bodys'] = response
		return item
	