用 scrapy 框架爬智联的招聘信息的时候报的错看不懂啊
2019-04-09 23:29:10 [selenium.webdriver.remote.remote_connection] DEBUG: Finished Request
2019-04-09 23:29:10 [selenium.webdriver.remote.remote_connection] DEBUG: POST http://127.0.0.1:50132/session/b97f6963939467e28aa83493fcf91f9d/url {"url": "
https://zhaopin.com", "sessionId": "b97f6963939467e28aa83493fcf91f9d"}
[7964:9720:0409/232912.471:ERROR:
ssl_client_socket_impl.cc(964)] handshake failed; returned -1, SSL error code 1, net_error -100
[7964:9720:0409/232912.505:ERROR:
ssl_client_socket_impl.cc(964)] handshake failed; returned -1, SSL error code 1, net_error -100
[7964:10376:0409/232913.146:ERROR:
platform_sensor_reader_win.cc(242)] NOT IMPLEMENTED
2019-04-09 23:29:14 [urllib3.connectionpool] DEBUG: http://127.0.0.1:50132 "POST /session/b97f6963939467e28aa83493fcf91f9d/url HTTP/1.1" 200 72
2019-04-09 23:29:14 [selenium.webdriver.remote.remote_connection] DEBUG: Finished Request
2019-04-09 23:29:14 [selenium.webdriver.remote.remote_connection] DEBUG: GET http://127.0.0.1:50132/session/b97f6963939467e28aa83493fcf91f9d/window_handle {"sessionId": "b97f6963939467e28aa83493fcf91f9d"}
2019-04-09 23:29:14 [urllib3.connectionpool] DEBUG: http://127.0.0.1:50132 "GET /session/b97f6963939467e28aa83493fcf91f9d/window_handle HTTP/1.1" 200 111
2019-04-09 23:29:14 [selenium.webdriver.remote.remote_connection] DEBUG: Finished Request
2019-04-09 23:29:14 [selenium.webdriver.remote.remote_connection] DEBUG: POST http://127.0.0.1:50132/session/b97f6963939467e28aa83493fcf91f9d/element {"using": "class name", "value": "zp-search__input", "sessionId": "b97f6963939467e28aa83493fcf9
1f9d"}
2019-04-09 23:29:14 [urllib3.connectionpool] DEBUG: http://127.0.0.1:50132 "POST /session/b97f6963939467e28aa83493fcf91f9d/element HTTP/1.1" 200 102
2019-04-09 23:29:14 [selenium.webdriver.remote.remote_connection] DEBUG: Finished Request
这是代码
class JobsSpider(scrapy.Spider):
name = 'jobs'
allowed_domains = ['
zhaopin.com']
start_urls = ['
https://www.zhaopin.com/']
def start_requests(self):
browser = webdriver.Chrome()
browser.get("
https://zhaopin.com")
windows = browser.current_window_handle
input = browser.find_element_by_class_name('zp-search__input')
input.send_keys('Python')
time.sleep(1)
button = browser.find_element_by_class_name('zp-search__btn')
button.click()
all_handles = browser.window_handles
for handle in all_handles:
if handle != windows:
browser.switch_to.window(handle)
url = browser.current_url
yield Request(url,callback = self.parse)
def parse(self, response):
le = LinkExtractor(restrict_css='div.contentpile__content__wrapper__item.clearfix')
for link in le.extract_links(response):
yield scrapy.Request(link.url,callback=self.parse_job)
def parse_job(self,response):
jobs = JobItem()
sel = response.css('div.main')
jobs['jobname'] = sel.css('
hi.l.info-h3::text').extract_first()
jobs['Cname'] = sel.css('div.company 1::text').extract_first()
jobs['salary'] = sel.css('
div.l.info-money strong::text').extract_first()
jobs['joblocation'] = sel.css('span.icon-address::text').extract_first()
jobs['experience'] = sel.css('
div.info-three.1').xpath('(.//span)[1].text()').extract_first()
jobs['education'] =sel.css('
div.info-three.1').xpath('(.//span)[2].text()').extract_first()
jobs['count'] =sel.css('
div.info-three.1').xpath('(.//span)[3].text()').extract_first()
jobs['jobintro'] = sel.css('div.pos-ul').extract
yield jobs
这是不是和 cookie 有什么关系啊 求各位大佬解答
V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。
V2EX is a community of developers, designers and creative people.