eslint

爬虫黑科技,我是怎么爬取 indeed 的职位数据的

天大地大妈咪最大 提交于 2020-07-29 06:44:38
原文链接: https://www.qiuzhi99.com/articles/javascript/885.html 最近在学习nodejs爬虫技术,学了request模块,所以想着写一个自己的爬虫项目,研究了半天,最后选定indeed作为目标网站,通过爬取indeed的职位数据,然后开发一个自己的职位搜索引擎,目前已经上线了,虽然功能还是比较简单,但还是贴一下网址 job search engine ,证明一下这个爬虫项目是有用的。下面就来讲讲整个爬虫的思路。 确定入口页面 众所周知,爬虫是需要入口页面的,通过入口页面,不断的爬取链接,最后爬取完整个网站。在这个第一步的时候,就遇到了困难,一般来说都是选取首页和列表页作为入口页面的,但是indeed的列表页面做了限制,不能爬取完整的列表,顶多只能抓取前100页,但是这没有难倒我,我发现indeed有一个 Browse Jobs 页面,通过这个页面,可以获取indeed按地区搜索和按类型搜索的所有列表。下面贴一下这个页面的解析代码。 start: async (page) : { const host = URL.parse(page.url).hostname; const tasks = []; try { const $ = cheerio.load(iconv.decode(page.con, 'utf-8'), {

vue-cli3及以上版本安装及创建项目

不想你离开。 提交于 2020-07-28 07:51:28
如果你已经安装了vue-cli2,你需要先卸载:npm uninstall -g vue-cli 安装 npm install -g @vue/cli 创建项目 创建名为myVue的项目: vue create myVue 你会被提示选取一个 preset。你可以选默认的包含了基本的 Babel + ESLint 设置的 preset,也可以选“手动选择特性”来选取需要的特性。 这个默认的设置非常适合快速创建一个新项目的原型,而手动设置则提供了更多的选项,它们是面向生产的项目更加需要的。 启动项目 cd myVue npm run serve 启动成功,结束! 来源: oschina 链接: https://my.oschina.net/u/4276902/blog/4280468

vue+element-ui JYAdmin后台管理系统模板-集成方案【项目搭建篇2】

青春壹個敷衍的年華 提交于 2020-07-27 00:02:03
项目搭建时间:2020-06-29 本章节:讲述基于vue/cli, 项目的基础搭建。 本主题讲述了: 1、跨域配置 2、axios请求封装 3、eslint配置 4、环境dev,test,pro(开发,测试,线上), run自动调用对应的接口(proxy多代理配置) vue+element-ui JYAdmin 后台管理系统模板-集成方案 从零到一的手写搭建全过程。 该项目不仅是一个持续完善、 高效简洁的后台管理系统模板, 还是一套企业级后台系统开发 集成方案,致力于打造一个 与时俱进、高效易懂、高复用、 易维护扩展的应用方案。 1、安装axios cnpm i axios --save    2、axios封装,调用以及api资源管理 @/serve/axiosResquest.js(axios封装) import axios from 'axios'; axios.interceptors.response.use( response => { return response }, error => { if (error && error.response) { const ERR_CODE_LIST = { //常见错误码列表 [400]: "请求错误", [401]: "登录失效或在其他地方已登录", [403]: "拒绝访问", [404]: "请求地址出错",

vsCode 扩展

生来就可爱ヽ(ⅴ<●) 提交于 2020-07-26 13:55:21
1. 名称: Auto Import ID: steoates.autoimport 说明: Automatically finds, parses and provides code actions and code completion for all available imports. Works with Typescript and TSX 版本: 1.5.3 发布者: steoates VS Marketplace 链接: https://marketplace.visualstudio.com/items?itemName=steoates.autoimport 2.名称: Beautify css/sass/scss/less ID: michelemelluso.code-beautifier 说明: Beautify css, sass and less code (extension for Visual Studio Code) 版本: 2.3.3 发布者: michelemelluso VS Marketplace 链接: https://marketplace.visualstudio.com/items?itemName=michelemelluso.code-beautifier 3.名称: Bluloco Dark Theme ID: uloco

Destructuring state/props in React

[亡魂溺海] 提交于 2020-07-17 12:22:31
问题 I'm learning React and I have Eslint installed in my project. It started giving me errors like Use callback in setState when referencing the previous state. (react/no-access-state-in-setstate) Must use destructuring state assignment (react/destructuring-assignment) I tried to look this up but couldn't understand properly. Can someone point me in the right direction with this? Here is my code that throws the errors: class LoginForm extends React.Component { state = { data: { email: "",

Why do linters pick on useless escape character?

旧街凉风 提交于 2020-07-16 10:39:07
问题 Escaping non-special characters in strings, template literals, and regular expressions doesn't have any effect Source: https://eslint.org/docs/rules/no-useless-escape But clearly this is wrong: There's nothing to "fix" here; we all know this is a perfectly valid sequence of characters. Joking aside what's the rationale behind this? If even ESLint acknowledges that there's no harm then why bother? It may be useless if you only look at the end result (I know that the \ character won't be

eslint imports in webpack: Unable to resolve path to module

為{幸葍}努か 提交于 2020-07-08 05:03:49
问题 With eslint-import-resolver-webpack I'm trying to let eslint know that I want to import files, by referencing a "shortcut" (eg. components/Counter). In the example below, webpack (v2.2.0-rc.3) builds fine, but the test fails because it's "Unable to resolve path to module 'components/Counter'". I get this error also for importing 'components/Counter/reducer', so it's not limited to index. Both running npm run lint and my IDE (IntelliJ) give the same error. Following the docs, I've set the

eslint imports in webpack: Unable to resolve path to module

一世执手 提交于 2020-07-08 05:03:34
问题 With eslint-import-resolver-webpack I'm trying to let eslint know that I want to import files, by referencing a "shortcut" (eg. components/Counter). In the example below, webpack (v2.2.0-rc.3) builds fine, but the test fails because it's "Unable to resolve path to module 'components/Counter'". I get this error also for importing 'components/Counter/reducer', so it's not limited to index. Both running npm run lint and my IDE (IntelliJ) give the same error. Following the docs, I've set the

eslint imports in webpack: Unable to resolve path to module

风格不统一 提交于 2020-07-08 05:03:13
问题 With eslint-import-resolver-webpack I'm trying to let eslint know that I want to import files, by referencing a "shortcut" (eg. components/Counter). In the example below, webpack (v2.2.0-rc.3) builds fine, but the test fails because it's "Unable to resolve path to module 'components/Counter'". I get this error also for importing 'components/Counter/reducer', so it's not limited to index. Both running npm run lint and my IDE (IntelliJ) give the same error. Following the docs, I've set the

Debugging: ESLint Warning “Function declared in a loop contains unsafe references to variable(s)…no-loop-func”

空扰寡人 提交于 2020-06-28 04:49:27
问题 Building a Sort-Visualizer in React using the Create-React-App [https://roy-05.github.io/sort-visualizer/ ] I'm animating each iteration of the loop using setTimeouts. On dev console I get the following warning: Line 156:32: Function declared in a loop contains unsafe references to variable(s) 'minimum', 'minimum', 'minimum', 'minimum' no-loop-func Here's the code-snippet: for(let i=0; i<arr.length-1; i++){ let minimum = i; //Declare minimum here setTimeout(()=>{ for(let j = i+1; j<arr.length