slzcc / Scrapy-51job-jobs

爬取 51Job 指定职位信息
3 stars 2 forks source link

IndexError: list index out of range #1

Open AnxietyVendor opened 2 years ago

AnxietyVendor commented 2 years ago

I've successfully brew install ed Redis and Elasticsearch and run the following command in Mac zsh shell. However, this error popped out. usr@localhost ~ % docker run --rm -it -e REDIS_DB_HOST=127.0.0.1 -e ELASTICSEARCH_DB_SERVER=http://localhost:9200 registry.aliyuncs.com/slzcc/scrapy-51job-jobs:elasticsearch-3.0 python company_resume_51job/company_name.py WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested Please according to the prompt to input, must strictly careful operation in order to avoid waste your how many repair operations. Please enter 'http://www.51job.com/' website for company name to crawl, must be the full name, it doesn't matter too much or you will climb to the company requirements. Please enter the need to search the company name: 大数据分析 Traceback (most recent call last): File "company_resume_51job/company_name.py", line 53, in <module> NumberPages = selector.xpath('//div[@class="dw_table"]/div[@class="dw_tlc"]/div[@class="rt"]/text()')[3].split('\xa0/\xa0')[1] IndexError: list index out of range

slzcc commented 2 years ago

这个代码已经与之前开发时 51job 网站获取的 xpath 参数不一样了所以会报错,网站内容展示一旦进行了更新就会出现异常,这个项目目前已经不在持续维护,你可以参照代码后进行修改。