search engine nodejs
1.0.0
search-engine-nodejs는 Aol, Ask, Baidu, Bing, Google 및 Yahoo와 같은 여러 검색 엔진으로 만들어졌습니다. 이 검색 엔진은 아직 완벽하지 않지만 개발하려는 사람이 있으면 계속하세요.
설치는 npm install
명령을 사용하여 수행됩니다.
$ npm install search-engine-nodejs
search-engine-nodejs는 다음 검색 엔진을 지원합니다:
다음 내용으로 index.js
라는 파일 이름을 만듭니다.
const search_engine = require ( 'search-engine-nodejs' ) . default ;
( async ( ) => {
const options = {
qs : {
q : 'Hello Search Engine'
}
}
// you can use: Aol, Ask, Baidu, Bing, Google or Yahoo
const results = await search_engine . Google ( options )
console . log ( results )
} ) ( ) ;
node index.js
명령을 실행하여 스크래핑을 시작하세요.
그리고 대략 이렇습니다
[
{
url : 'https://support.google.com/websearch/forum/AAAAgtjJeM4tswt4Orqfos/?hl=uk' ,
title : 'How to switch to Google as my default search engine in MS EDGE ...' ,
description : '15.01.16. Rotary Steve. Hello,. Perhaps this search can be helpful.... https://www. microsoft.com/en-us/search/result.aspx?q=default%20search%20engine.'
} ,
...
{
url : 'http://www.proz.com/forum/sdl_trados_support/255884-an_easy_way_to_copy_paste_source_terms_from_trados_studio_into_a_search_engine_or_dictionary.html?text=An%20easy%20way%20to%20copy-paste%20source%20terms%20from%20Trados%20Studio%20into%20a%20search%20engine%20or%20dictionary%3F%20?text=An%20easy%20way%20to%20copy-paste%20source%20terms%20from%20Trados%20Studio%20into%20a%20search%20engine%20or%20dictionary%3F%20(SDL%20Trados%20support)&print=1' ,
title : 'An easy way to copy-paste source terms from Trados Studio into a ...' ,
description : '10 Sep 2013 - ... 20Trados%20Studio%20into%20a%20search%20engine%20or%20dictionary %3F%20?text=An ... Hello everyone, .... hi Paul, Sep 10, 2013 ...'
}
]
결과를 2개 이상 얻으려면 pageOfResult
옵션을 추가하세요.
( async ( ) => {
const options = {
pageOfResult : 2 ,
qs : {
q : 'Hello Search Engine'
}
}
// you can use: Aol, Ask, Baidu, Bing, Google or Yahoo
const results = await search_engine . Google ( options )
console . log ( results )
// This will display the second results page
} ) ( ) ;
node index.js
명령을 실행하여 스크래핑을 시작하세요.
그리고 대략 이렇습니다
[
{
url : 'https://www.hijden.nl/homepages/digital-agency/' ,
title : 'Digital Agency - Hijden - Ontwerp & Branding' ,
description : '... 22%2C%22text%22%3A%22Our%20approach%20is%20to%20focus%20on %20growing%20visibility%20in%20organic%20search%20engine%20results.Tidak ada: Hello%'
} ,
...
{
url : 'https://easynewsweb.com/amp/%F0%9F%98%8D-fall-in-love-with-your-search-engine-results-with-25-off-aioseop-pro-%F0%9F%98%8D/' ,
title : 'Fall In Love With Your Search Engine Results With 25% Off ...' ,
description : "Hey – As Valentine's Day is approaching, we'd like to take this opportunity to ... % 20Fall%20In%20Love%20With%20Your%20Search%20Engine%20Results% ..."
}
]
이렇게 가져오려면 요구 사항을 변경하면 됩니다.
import SearchEngine from "search-engine-nodejs" ;
그리고 이것은 코드입니다
import SearchEngine from "search-engine-nodejs" ;
( async ( ) => {
const options = {
qs : {
q : 'Hello Search Engine'
}
}
// you can use: Aol, Ask, Baidu, Bing, Google or Yahoo
const results = await SearchEngine . Google ( options )
console . log ( results )
} ) ( ) ;