jpub / jswebcrawler Goto Github PK
View Code? Open in Web Editor NEW<자바스크립트와 Node.js를 이용한 웹 크롤링 테크닉> 리포지토리
<자바스크립트와 Node.js를 이용한 웹 크롤링 테크닉> 리포지토리
fs.writeFile(fname,text); 부분에서 오류가 나길래 공식 문서를 찾아보니
fs.writeFile(file, data[, options], callback)
https://nodejs.org/dist/latest-v10.x/docs/api/fs.html#fs_fs_writefile_file_data_options_callback
함수의 인자로 3개를 받고 마지막에 콜백함수를 받는다고 합니다.
예제코드를 아래와 같이 바꾸니 해결됬습니다.
fs.writeFile(fname, text,(err)=>{
if (err) throw err;
});
We are a group of researchers from Leiden University, and we conduct research on vulnerabilities in open-source software. We have discovered and verified a high-severity vulnerability in your project(Jpub/JSWebCrawler). Explaining the vulnerability further in this issue could allow malicious users to access details, so we recommend enabling private vulnerability reporting on GitHub to discuss this matter confidentially.
After you have enabled this feature, please add a comment to this issue so we can continue our discussion. If you have any questions, feel free to leave a reply here or send an email to: j.akhoundali [at] liacs.leidenuniv.nl
I can not scrape pages dynamically created with jquery. What are some ways to handle this?
현상 : 코드 ( src/ch02/01-download/download-rhino.js ) 실행 시 에러발생
환경 : jdk 1.8.0_131, rhino 1.7.9
에러 상세 :
org.mozilla.javascript.WrappedException: Wrapped java.io.IOException: Server ret urned HTTP response code: 403 for URL: http://jpub.tistory.com/ at org.mozilla.javascript.Context.throwAsScriptRuntimeEx(Context.java:19 32) at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:148) at org.mozilla.javascript.NativeJavaMethod.call(NativeJavaMethod.java:22 5) at org.mozilla.javascript.optimizer.OptRuntime.callProp0(OptRuntime.java :85) at org.mozilla.javascript.gen.download_rhino_js_1._c_script_0(Unknown So urce) at org.mozilla.javascript.gen.download_rhino_js_1.call(Unknown Source) at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:4 05) at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:350 8) at org.mozilla.javascript.gen.download_rhino_js_1.call(Unknown Source) at org.mozilla.javascript.gen.download_rhino_js_1.exec(Unknown Source) at org.mozilla.javascript.tools.shell.Main.processFileSecure(Main.java:6 01) at org.mozilla.javascript.tools.shell.Main.processFile(Main.java:560) at org.mozilla.javascript.tools.shell.Main.processSource(Main.java:531) at org.mozilla.javascript.tools.shell.Main.processFiles(Main.java:179) at org.mozilla.javascript.tools.shell.Main$IProxy.run(Main.java:100) at org.mozilla.javascript.Context.call(Context.java:544) at org.mozilla.javascript.ContextFactory.call(ContextFactory.java:515) at org.mozilla.javascript.tools.shell.Main.exec(Main.java:161) at org.mozilla.javascript.tools.shell.Main.main(Main.java:136) Caused by: java.io.IOException: Server returned HTTP response code: 403 for URL: http://jpub.tistory.com/ at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLCo nnection.java:1876) at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLCon nection.java:1474) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl. java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces sorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:126) ... 17 more
안녕하세요. 자바스크립트와 Node.js를 이용한 웹 크롤링 테크닉 책을 잘 보고 있습니다. 😄
ch05/04-correct/correct.js 파일 내 4번째 라인에서 var Mecab = require('./mecab-mod-sync.js');
하는 부분의 모듈 명이 책에서 만든 mecab-mod.js
와는 다르네요.
그리고 25번째 라인에서 mecab.parse()
호출시 콜백함수 인자 없이 호출하고 있는데요... 혹시 다른 모듈로 작성하셨나 궁금합니다.
확인을 부탁드립니다.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.