removed some search engines, added tests for existing, added yandex search engines
10
README.md
@ -27,17 +27,12 @@ Se-scraper supports the following search engines:
|
|||||||
* Google News
|
* Google News
|
||||||
* Google News App version (https://news.google.com)
|
* Google News App version (https://news.google.com)
|
||||||
* Google Image
|
* Google Image
|
||||||
* Amazon
|
|
||||||
* Bing
|
* Bing
|
||||||
* Bing News
|
* Bing News
|
||||||
* Baidu
|
|
||||||
* Youtube
|
|
||||||
* Infospace
|
* Infospace
|
||||||
* Duckduckgo
|
* Duckduckgo
|
||||||
|
* Yandex
|
||||||
* Webcrawler
|
* Webcrawler
|
||||||
* Reuters
|
|
||||||
* Cnbc
|
|
||||||
* Marketwatch
|
|
||||||
|
|
||||||
This module uses puppeteer and a modified version of [puppeteer-cluster](https://github.com/thomasdondorf/puppeteer-cluster/). It was created by the Developer of [GoogleScraper](https://github.com/NikolaiT/GoogleScraper), a module with 1800 Stars on Github.
|
This module uses puppeteer and a modified version of [puppeteer-cluster](https://github.com/thomasdondorf/puppeteer-cluster/). It was created by the Developer of [GoogleScraper](https://github.com/NikolaiT/GoogleScraper), a module with 1800 Stars on Github.
|
||||||
|
|
||||||
@ -233,10 +228,8 @@ You can define your own scraper class and use it within se-scraper.
|
|||||||
|
|
||||||
* [Reuse existing browser](examples/multiple_search_engines.js) yields [these results](examples/results/multiple_search_engines.json)
|
* [Reuse existing browser](examples/multiple_search_engines.js) yields [these results](examples/results/multiple_search_engines.json)
|
||||||
* [Simple example scraping google](examples/quickstart.js) yields [these results](examples/results/data.json)
|
* [Simple example scraping google](examples/quickstart.js) yields [these results](examples/results/data.json)
|
||||||
* [Simple example scraping baidu](examples/baidu.js) yields [these results](examples/results/baidu.json)
|
|
||||||
* [Scrape with one proxy per browser](examples/proxies.js) yields [these results](examples/results/proxyresults.json)
|
* [Scrape with one proxy per browser](examples/proxies.js) yields [these results](examples/results/proxyresults.json)
|
||||||
* [Scrape 100 keywords on Bing with multible tabs in one browser](examples/multiple_tabs.js) produces [this](examples/results/bing.json)
|
* [Scrape 100 keywords on Bing with multible tabs in one browser](examples/multiple_tabs.js) produces [this](examples/results/bing.json)
|
||||||
* [Scrape two keywords on Amazon](examples/amazon.js) produces [this](examples/results/amazon.json)
|
|
||||||
* [Inject your own scraping logic](examples/pluggable.js)
|
* [Inject your own scraping logic](examples/pluggable.js)
|
||||||
* [For the Lulz: Scraping google dorks for SQL injection vulnerabilites and confirming them.](examples/for_the_lulz.js)
|
* [For the Lulz: Scraping google dorks for SQL injection vulnerabilites and confirming them.](examples/for_the_lulz.js)
|
||||||
* [Scrape google maps/locations](examples/google_maps.js) yields [these results](examples/results/maps.json)
|
* [Scrape google maps/locations](examples/google_maps.js) yields [these results](examples/results/maps.json)
|
||||||
@ -324,6 +317,7 @@ page.on('request', (req) => {
|
|||||||
|
|
||||||
Consider the following resources:
|
Consider the following resources:
|
||||||
|
|
||||||
|
* https://antoinevastel.com/bot%20detection/2019/07/19/detecting-chrome-headless-v3.html
|
||||||
* https://intoli.com/blog/making-chrome-headless-undetectable/
|
* https://intoli.com/blog/making-chrome-headless-undetectable/
|
||||||
* https://intoli.com/blog/not-possible-to-block-chrome-headless/
|
* https://intoli.com/blog/not-possible-to-block-chrome-headless/
|
||||||
* https://news.ycombinator.com/item?id=16179602
|
* https://news.ycombinator.com/item?id=16179602
|
||||||
|
@ -1,25 +0,0 @@
|
|||||||
const se_scraper = require('./../src/node_scraper.js');
|
|
||||||
|
|
||||||
(async () => {
|
|
||||||
let browser_config = {
|
|
||||||
headless: true,
|
|
||||||
debug_level: 1,
|
|
||||||
output_file: 'examples/results/amazon.json',
|
|
||||||
amazon_settings: {
|
|
||||||
amazon_domain: 'amazon.com',
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
let scrape_job = {
|
|
||||||
search_engine: 'amazon',
|
|
||||||
keywords: ['iphone', 'drone'],
|
|
||||||
num_pages: 1,
|
|
||||||
};
|
|
||||||
|
|
||||||
var scraper = new se_scraper.ScrapeManager(browser_config);
|
|
||||||
await scraper.start();
|
|
||||||
|
|
||||||
var results = await scraper.scrape(scrape_job);
|
|
||||||
console.dir(results, {depth: null, colors: true});
|
|
||||||
await scraper.quit();
|
|
||||||
})();
|
|
@ -1,21 +0,0 @@
|
|||||||
const se_scraper = require('./../src/node_scraper.js');
|
|
||||||
|
|
||||||
(async () => {
|
|
||||||
let browser_config = {
|
|
||||||
debug_level: 1,
|
|
||||||
output_file: 'examples/results/data.json',
|
|
||||||
};
|
|
||||||
|
|
||||||
let scrape_job = {
|
|
||||||
search_engine: 'baidu',
|
|
||||||
keywords: ['cat', 'mouse'],
|
|
||||||
num_pages: 1,
|
|
||||||
};
|
|
||||||
|
|
||||||
var scraper = new se_scraper.ScrapeManager(browser_config);
|
|
||||||
await scraper.start();
|
|
||||||
|
|
||||||
var results = await scraper.scrape(scrape_job);
|
|
||||||
console.dir(results, {depth: null, colors: true});
|
|
||||||
await scraper.quit();
|
|
||||||
})();
|
|
144
package-lock.json
generated
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "se-scraper",
|
"name": "se-scraper",
|
||||||
"version": "1.4.5",
|
"version": "1.5.0",
|
||||||
"lockfileVersion": 1,
|
"lockfileVersion": 1,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
@ -18,9 +18,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"@types/node": {
|
"@types/node": {
|
||||||
"version": "10.12.18",
|
"version": "12.7.5",
|
||||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-10.12.18.tgz",
|
"resolved": "https://registry.npmjs.org/@types/node/-/node-12.7.5.tgz",
|
||||||
"integrity": "sha512-fh+pAqt4xRzPfqA6eh3Z2y6fyZavRIumvjhaCL753+TVkGKGhpPeyrJG2JftD0T9q4GF00KjefsQ+PQNDdWQaQ=="
|
"integrity": "sha512-9fq4jZVhPNW8r+UYKnxF1e2HkDWOWKM5bC2/7c9wPV835I0aOrVbS/Hw/pWPk2uKrNXQqg9Z959Kz+IYDd5p3w=="
|
||||||
},
|
},
|
||||||
"accepts": {
|
"accepts": {
|
||||||
"version": "1.3.7",
|
"version": "1.3.7",
|
||||||
@ -86,20 +86,15 @@
|
|||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"async-limiter": {
|
"async-limiter": {
|
||||||
"version": "1.0.0",
|
"version": "1.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/async-limiter/-/async-limiter-1.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/async-limiter/-/async-limiter-1.0.1.tgz",
|
||||||
"integrity": "sha512-jp/uFnooOiO+L211eZOoSyzpOITMXx1rBITauYykG3BRYPu8h0UcxsPNB04RR5vo4Tyz3+ay17tR6JVf9qzYWg=="
|
"integrity": "sha512-csOlWGAcRFJaI6m+F2WKdnMKr4HhdhFVBk0H/QbJFMCr+uO2kwohwXQPxw/9OCxp05r5ghVBFSyioixx3gfkNQ=="
|
||||||
},
|
},
|
||||||
"balanced-match": {
|
"balanced-match": {
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz",
|
||||||
"integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c="
|
"integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c="
|
||||||
},
|
},
|
||||||
"bluebird": {
|
|
||||||
"version": "3.5.3",
|
|
||||||
"resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.5.3.tgz",
|
|
||||||
"integrity": "sha512-/qKPUQlaW1OyR51WeCPBvRnAlnZFUJkCSG5HzGnuIqhgyJtF+T94lFnn33eiazjRm2LAHVy2guNnaq48X9SJuw=="
|
|
||||||
},
|
|
||||||
"body-parser": {
|
"body-parser": {
|
||||||
"version": "1.19.0",
|
"version": "1.19.0",
|
||||||
"resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.19.0.tgz",
|
"resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.19.0.tgz",
|
||||||
@ -231,12 +226,12 @@
|
|||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"cheerio": {
|
"cheerio": {
|
||||||
"version": "1.0.0-rc.2",
|
"version": "1.0.0-rc.3",
|
||||||
"resolved": "https://registry.npmjs.org/cheerio/-/cheerio-1.0.0-rc.2.tgz",
|
"resolved": "https://registry.npmjs.org/cheerio/-/cheerio-1.0.0-rc.3.tgz",
|
||||||
"integrity": "sha1-S59TqBsn5NXawxwP/Qz6A8xoMNs=",
|
"integrity": "sha512-0td5ijfUPuubwLUu0OBoe98gZj8C/AA+RW3v67GPlGOrvxWjZmBXiBCRU+I8VEiNyJzjth40POfHiz2RB3gImA==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"css-select": "~1.2.0",
|
"css-select": "~1.2.0",
|
||||||
"dom-serializer": "~0.1.0",
|
"dom-serializer": "~0.1.1",
|
||||||
"entities": "~1.1.1",
|
"entities": "~1.1.1",
|
||||||
"htmlparser2": "^3.9.1",
|
"htmlparser2": "^3.9.1",
|
||||||
"lodash": "^4.15.0",
|
"lodash": "^4.15.0",
|
||||||
@ -295,11 +290,6 @@
|
|||||||
"integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=",
|
"integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"commander": {
|
|
||||||
"version": "2.19.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/commander/-/commander-2.19.0.tgz",
|
|
||||||
"integrity": "sha512-6tvAOO+D6OENvRAh524Dh9jcfKTYDQAqvqezbCW82xj5X0pSrcpxtvRKHLG0yBY6SD7PSDrJaj+0AiOcKVd1Xg=="
|
|
||||||
},
|
|
||||||
"concat-map": {
|
"concat-map": {
|
||||||
"version": "0.0.1",
|
"version": "0.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",
|
||||||
@ -393,9 +383,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"css-what": {
|
"css-what": {
|
||||||
"version": "2.1.2",
|
"version": "2.1.3",
|
||||||
"resolved": "https://registry.npmjs.org/css-what/-/css-what-2.1.2.tgz",
|
"resolved": "https://registry.npmjs.org/css-what/-/css-what-2.1.3.tgz",
|
||||||
"integrity": "sha512-wan8dMWQ0GUeF7DGEPVjhHemVW/vy6xUYmFzRY8RYqgA0JtXC9rJmbScBjqSu6dg9q0lwPQy6ZAmJVr3PPTvqQ=="
|
"integrity": "sha512-a+EPoD+uZiNfh+5fxw2nO9QwFa6nJe2Or35fGY6Ipw1R3R4AGz1d1TEZrCegvw2YTmZ0jXirGYlzxxpYSHwpEg=="
|
||||||
},
|
},
|
||||||
"debug": {
|
"debug": {
|
||||||
"version": "4.1.1",
|
"version": "4.1.1",
|
||||||
@ -469,19 +459,12 @@
|
|||||||
"integrity": "sha1-so6eIiDaXsSffqW7JKR3h0Be6xE="
|
"integrity": "sha1-so6eIiDaXsSffqW7JKR3h0Be6xE="
|
||||||
},
|
},
|
||||||
"dom-serializer": {
|
"dom-serializer": {
|
||||||
"version": "0.1.0",
|
"version": "0.1.1",
|
||||||
"resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-0.1.0.tgz",
|
"resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-0.1.1.tgz",
|
||||||
"integrity": "sha1-BzxpdUbOB4DOI75KKOKT5AvDDII=",
|
"integrity": "sha512-l0IU0pPzLWSHBcieZbpOKgkIn3ts3vAh7ZuFyXNwJxJXk/c4Gwj9xaTJwIDVQCXawWD0qb3IzMGH5rglQaO0XA==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"domelementtype": "~1.1.1",
|
"domelementtype": "^1.3.0",
|
||||||
"entities": "~1.1.1"
|
"entities": "^1.1.1"
|
||||||
},
|
|
||||||
"dependencies": {
|
|
||||||
"domelementtype": {
|
|
||||||
"version": "1.1.3",
|
|
||||||
"resolved": "http://registry.npmjs.org/domelementtype/-/domelementtype-1.1.3.tgz",
|
|
||||||
"integrity": "sha1-vSh3PiZCiBrsUVRJJCmcXNgiGFs="
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"domelementtype": {
|
"domelementtype": {
|
||||||
@ -876,16 +859,16 @@
|
|||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"htmlparser2": {
|
"htmlparser2": {
|
||||||
"version": "3.10.0",
|
"version": "3.10.1",
|
||||||
"resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-3.10.0.tgz",
|
"resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-3.10.1.tgz",
|
||||||
"integrity": "sha512-J1nEUGv+MkXS0weHNWVKJJ+UrLfePxRWpN3C9bEi9fLxL2+ggW94DQvgYVXsaT30PGwYRIZKNZXuyMhp3Di4bQ==",
|
"integrity": "sha512-IgieNijUMbkDovyoKObU1DUhm1iwNYE/fuifEoEHfd1oZKZDaONBSkal7Y01shxsM49R4XaMdGez3WnF9UfiCQ==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"domelementtype": "^1.3.0",
|
"domelementtype": "^1.3.1",
|
||||||
"domhandler": "^2.3.0",
|
"domhandler": "^2.3.0",
|
||||||
"domutils": "^1.5.1",
|
"domutils": "^1.5.1",
|
||||||
"entities": "^1.1.1",
|
"entities": "^1.1.1",
|
||||||
"inherits": "^2.0.1",
|
"inherits": "^2.0.1",
|
||||||
"readable-stream": "^3.0.6"
|
"readable-stream": "^3.1.1"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"http-cache-semantics": {
|
"http-cache-semantics": {
|
||||||
@ -1489,36 +1472,6 @@
|
|||||||
"resolved": "https://registry.npmjs.org/pend/-/pend-1.2.0.tgz",
|
"resolved": "https://registry.npmjs.org/pend/-/pend-1.2.0.tgz",
|
||||||
"integrity": "sha1-elfrVQpng/kRUzH89GY9XI4AelA="
|
"integrity": "sha1-elfrVQpng/kRUzH89GY9XI4AelA="
|
||||||
},
|
},
|
||||||
"portastic": {
|
|
||||||
"version": "1.0.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/portastic/-/portastic-1.0.1.tgz",
|
|
||||||
"integrity": "sha1-HJgF1D+uj2pAzw28d5QJGi6dDSo=",
|
|
||||||
"requires": {
|
|
||||||
"bluebird": "^2.9.34",
|
|
||||||
"commander": "^2.8.1",
|
|
||||||
"debug": "^2.2.0"
|
|
||||||
},
|
|
||||||
"dependencies": {
|
|
||||||
"bluebird": {
|
|
||||||
"version": "2.11.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/bluebird/-/bluebird-2.11.0.tgz",
|
|
||||||
"integrity": "sha1-U0uQM8AiyVecVro7Plpcqvu2UOE="
|
|
||||||
},
|
|
||||||
"debug": {
|
|
||||||
"version": "2.6.9",
|
|
||||||
"resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz",
|
|
||||||
"integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==",
|
|
||||||
"requires": {
|
|
||||||
"ms": "2.0.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"ms": {
|
|
||||||
"version": "2.0.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
|
|
||||||
"integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g="
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"prepend-http": {
|
"prepend-http": {
|
||||||
"version": "2.0.0",
|
"version": "2.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/prepend-http/-/prepend-http-2.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/prepend-http/-/prepend-http-2.0.0.tgz",
|
||||||
@ -1543,16 +1496,6 @@
|
|||||||
"ipaddr.js": "1.9.0"
|
"ipaddr.js": "1.9.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"proxy-chain": {
|
|
||||||
"version": "0.2.7",
|
|
||||||
"resolved": "https://registry.npmjs.org/proxy-chain/-/proxy-chain-0.2.7.tgz",
|
|
||||||
"integrity": "sha512-e0s94WDfooeC3zQkvIJ/Eudiy/AywTQK4K6PMYbZdBE2m/eug54ThgCPdBE4txHvzi0A0gAVbX04Kt4RygTlRQ==",
|
|
||||||
"requires": {
|
|
||||||
"bluebird": "^3.5.1",
|
|
||||||
"portastic": "^1.0.1",
|
|
||||||
"underscore": "^1.9.1"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"proxy-from-env": {
|
"proxy-from-env": {
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.0.0.tgz",
|
||||||
@ -1568,9 +1511,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"puppeteer": {
|
"puppeteer": {
|
||||||
"version": "1.18.1",
|
"version": "1.20.0",
|
||||||
"resolved": "https://registry.npmjs.org/puppeteer/-/puppeteer-1.18.1.tgz",
|
"resolved": "https://registry.npmjs.org/puppeteer/-/puppeteer-1.20.0.tgz",
|
||||||
"integrity": "sha512-luUy0HPSuWPsPZ1wAp6NinE0zgetWtudf5zwZ6dHjMWfYpTQcmKveFRox7VBNhQ98OjNA9PQ9PzQyX8k/KrxTg==",
|
"integrity": "sha512-bt48RDBy2eIwZPrkgbcwHtb51mj2nKvHOPMaSH2IsWiv7lOG9k9zhaRzpDZafrk05ajMc3cu+lSQYYOfH2DkVQ==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"debug": "^4.1.0",
|
"debug": "^4.1.0",
|
||||||
"extract-zip": "^1.6.6",
|
"extract-zip": "^1.6.6",
|
||||||
@ -1689,9 +1632,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"readable-stream": {
|
"readable-stream": {
|
||||||
"version": "3.1.1",
|
"version": "3.4.0",
|
||||||
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.1.1.tgz",
|
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.4.0.tgz",
|
||||||
"integrity": "sha512-DkN66hPyqDhnIQ6Jcsvx9bFjhw214O4poMBcIMgPVpQvNy9a0e0Uhg5SqySyDKAmUlwt8LonTBz1ezOnM8pUdA==",
|
"integrity": "sha512-jItXPLmrSR8jmTRmRWJXCnGJsfy85mB3Wd/uINMXA65yrnFo0cPClFIUWzo2najVNSl+mx7/4W8ttlLWJe99pQ==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"inherits": "^2.0.3",
|
"inherits": "^2.0.3",
|
||||||
"string_decoder": "^1.1.1",
|
"string_decoder": "^1.1.1",
|
||||||
@ -1719,9 +1662,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"rimraf": {
|
"rimraf": {
|
||||||
"version": "2.6.3",
|
"version": "2.7.1",
|
||||||
"resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.3.tgz",
|
"resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz",
|
||||||
"integrity": "sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==",
|
"integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"glob": "^7.1.3"
|
"glob": "^7.1.3"
|
||||||
}
|
}
|
||||||
@ -1880,11 +1823,18 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"string_decoder": {
|
"string_decoder": {
|
||||||
"version": "1.2.0",
|
"version": "1.3.0",
|
||||||
"resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.2.0.tgz",
|
"resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz",
|
||||||
"integrity": "sha512-6YqyX6ZWEYguAxgZzHGL7SsCeGx3V2TtOTqZz1xSTSWnqsbWwbptafNyvf/ACquZUXV3DANr5BDIwNYe1mN42w==",
|
"integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"safe-buffer": "~5.1.0"
|
"safe-buffer": "~5.2.0"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"safe-buffer": {
|
||||||
|
"version": "5.2.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.0.tgz",
|
||||||
|
"integrity": "sha512-fZEwUGbVl7kouZs1jCdMLdt95hdIv0ZeHg6L7qPeciMZhZ+/gdesW4wgTARkrFWEpspjEATAzUGPG8N2jJiwbg=="
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"strip-ansi": {
|
"strip-ansi": {
|
||||||
@ -1974,9 +1924,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"user-agents": {
|
"user-agents": {
|
||||||
"version": "1.0.321",
|
"version": "1.0.378",
|
||||||
"resolved": "https://registry.npmjs.org/user-agents/-/user-agents-1.0.321.tgz",
|
"resolved": "https://registry.npmjs.org/user-agents/-/user-agents-1.0.378.tgz",
|
||||||
"integrity": "sha512-2oR/KDESLUTQLEKymUP6/p+jTSKW6fVEEGKXO0EF8jjHIj3QNDBTUGbvp3kpWvuO3k65xkrjHzatUWun1t0FAg==",
|
"integrity": "sha512-Ls0fWtSVHZZE8V/9glgIWWT/ZLfM+P2fbE6dK/6sKOz0woerfFtdHoifRBVZ9uUDKkVGXLyrmF3EdXz+hUJufg==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"dot-json": "^1.1.0",
|
"dot-json": "^1.1.0",
|
||||||
"lodash.clonedeep": "^4.5.0"
|
"lodash.clonedeep": "^4.5.0"
|
||||||
|
11
package.json
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "se-scraper",
|
"name": "se-scraper",
|
||||||
"version": "1.4.7",
|
"version": "1.5.0",
|
||||||
"description": "A module using puppeteer to scrape several search engines such as Google, Duckduckgo, Bing or Baidu",
|
"description": "A module using puppeteer to scrape several search engines such as Google, Bing and Duckduckgo",
|
||||||
"homepage": "https://scrapeulous.com/",
|
"homepage": "https://scrapeulous.com/",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
@ -21,17 +21,16 @@
|
|||||||
},
|
},
|
||||||
"license": "ISC",
|
"license": "ISC",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"cheerio": "^1.0.0-rc.2",
|
"cheerio": "^1.0.0-rc.3",
|
||||||
"debug": "^4.1.1",
|
"debug": "^4.1.1",
|
||||||
"express": "^4.17.1",
|
"express": "^4.17.1",
|
||||||
"got": "^9.6.0",
|
"got": "^9.6.0",
|
||||||
"lodash": "^4.17.14",
|
"lodash": "^4.17.14",
|
||||||
"proxy-chain": "^0.2.7",
|
"puppeteer": "^1.20.0",
|
||||||
"puppeteer": "^1.18.1",
|
|
||||||
"puppeteer-cluster": "^0.13.0",
|
"puppeteer-cluster": "^0.13.0",
|
||||||
"puppeteer-extra": "^2.1.3",
|
"puppeteer-extra": "^2.1.3",
|
||||||
"puppeteer-extra-plugin-stealth": "^2.2.2",
|
"puppeteer-extra-plugin-stealth": "^2.2.2",
|
||||||
"user-agents": "^1.0.321"
|
"user-agents": "^1.0.378"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"chai": "^4.2.0",
|
"chai": "^4.2.0",
|
||||||
|
10
run.js
@ -8,7 +8,7 @@ let browser_config = {
|
|||||||
// if random_user_agent is set to True, a random user agent is chosen
|
// if random_user_agent is set to True, a random user agent is chosen
|
||||||
random_user_agent: false,
|
random_user_agent: false,
|
||||||
// whether to start the browser in headless mode
|
// whether to start the browser in headless mode
|
||||||
headless: true,
|
headless: false,
|
||||||
// whether debug information should be printed
|
// whether debug information should be printed
|
||||||
// level 0: print nothing
|
// level 0: print nothing
|
||||||
// level 1: print most important info
|
// level 1: print most important info
|
||||||
@ -43,9 +43,9 @@ let browser_config = {
|
|||||||
// scrape config can change on each scrape() call
|
// scrape config can change on each scrape() call
|
||||||
let scrape_config = {
|
let scrape_config = {
|
||||||
// which search engine to scrape
|
// which search engine to scrape
|
||||||
search_engine: 'google_image',
|
search_engine: 'duckduckgo',
|
||||||
// an array of keywords to scrape
|
// an array of keywords to scrape
|
||||||
keywords: ['iphone'],
|
keywords: ['cloud service'],
|
||||||
// the number of pages to scrape for each keyword
|
// the number of pages to scrape for each keyword
|
||||||
num_pages: 1,
|
num_pages: 1,
|
||||||
|
|
||||||
@ -62,10 +62,10 @@ let browser_config = {
|
|||||||
// is drawn before every request. empty string for no sleeping.
|
// is drawn before every request. empty string for no sleeping.
|
||||||
sleep_range: '',
|
sleep_range: '',
|
||||||
// path to output file, data will be stored in JSON
|
// path to output file, data will be stored in JSON
|
||||||
output_file: 'google.json',
|
output_file: '',
|
||||||
// whether to prevent images, css, fonts from being loaded
|
// whether to prevent images, css, fonts from being loaded
|
||||||
// will speed up scraping a great deal
|
// will speed up scraping a great deal
|
||||||
block_assets: true,
|
block_assets: false,
|
||||||
// check if headless chrome escapes common detection techniques
|
// check if headless chrome escapes common detection techniques
|
||||||
// this is a quick test and should be used for debugging
|
// this is a quick test and should be used for debugging
|
||||||
test_evasion: false,
|
test_evasion: false,
|
||||||
|
@ -1,145 +0,0 @@
|
|||||||
const cheerio = require('cheerio');
|
|
||||||
const Scraper = require('./se_scraper');
|
|
||||||
|
|
||||||
class AmazonScraper extends Scraper {
|
|
||||||
|
|
||||||
constructor(...args) {
|
|
||||||
super(...args);
|
|
||||||
}
|
|
||||||
|
|
||||||
parse(html) {
|
|
||||||
// load the page source into cheerio
|
|
||||||
const $ = cheerio.load(html);
|
|
||||||
|
|
||||||
// perform queries
|
|
||||||
const results = [];
|
|
||||||
$('#search .s-result-item').each((i, product) => {
|
|
||||||
//TODO: this is absolute horrible, but so is parsing html
|
|
||||||
|
|
||||||
let resobj = {};
|
|
||||||
try {
|
|
||||||
resobj.image = $(product).find('[data-component-type="s-product-image"] a').attr('href');
|
|
||||||
} catch (err) {
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
|
||||||
resobj.seller = $(product).find('h5 + div span').text();
|
|
||||||
} catch (err) {
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
|
||||||
resobj.link = $(product).find('a.a-link-normal').attr('href');
|
|
||||||
} catch (err) {
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
|
||||||
resobj.title = $(product).find('a.a-link-normal .a-text-normal').text();
|
|
||||||
} catch (err) {
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
|
||||||
resobj.stars = $(product).find('a i span').text();
|
|
||||||
} catch (err) {
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
|
||||||
resobj.num_reviews = $(product).find('span > a > span:first-child').text();
|
|
||||||
} catch (err) {
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
|
||||||
resobj.price = $(product).find('.a-price .a-offscreen').text();
|
|
||||||
} catch (err) {
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
|
||||||
resobj.oldprice = $(product).find('.a-price[data-a-color="secondary"]').text();
|
|
||||||
} catch (err) {
|
|
||||||
}
|
|
||||||
results.push(resobj);
|
|
||||||
});
|
|
||||||
|
|
||||||
let no_results = this.no_results(
|
|
||||||
['Keine Ergebnisse', 'No results for '],
|
|
||||||
$('#search').text()
|
|
||||||
);
|
|
||||||
|
|
||||||
let effective_query = $('[data-component-type="s-result-info-bar"] span.a-text-bold').text() || '';
|
|
||||||
|
|
||||||
const cleaned = this.clean_results(results, ['title', 'link', 'price', 'stars']);
|
|
||||||
|
|
||||||
return {
|
|
||||||
time: (new Date()).toUTCString(),
|
|
||||||
num_results: $('[data-component-type="s-result-info-bar"] .a-spacing-top-small').text(),
|
|
||||||
no_results: no_results,
|
|
||||||
effective_query: effective_query,
|
|
||||||
results: cleaned
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
async load_start_page() {
|
|
||||||
let startUrl = 'https://www.amazon.com/';
|
|
||||||
|
|
||||||
if (this.config.amazon_settings) {
|
|
||||||
startUrl = `https://www.${this.config.amazon_settings.amazon_domain}/s?`;
|
|
||||||
if (this.config.amazon_settings.amazon_domain) {
|
|
||||||
startUrl = `https://www.${this.config.amazon_settings.amazon_domain}/s?`;
|
|
||||||
} else {
|
|
||||||
startUrl = 'https://www.amazon.com/s?';
|
|
||||||
}
|
|
||||||
|
|
||||||
for (var key in this.config.amazon_settings) {
|
|
||||||
if (key !== 'amazon_domain') {
|
|
||||||
startUrl += `${key}=${this.config.amazon_settings[key]}&`
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this.config.verbose) {
|
|
||||||
console.log('Using startUrl: ' + startUrl);
|
|
||||||
}
|
|
||||||
|
|
||||||
this.last_response = await this.page.goto(startUrl);
|
|
||||||
|
|
||||||
try {
|
|
||||||
await this.page.waitForSelector('input[name="field-keywords"]', { timeout: this.STANDARD_TIMEOUT });
|
|
||||||
} catch (e) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
async search_keyword(keyword) {
|
|
||||||
const input = await this.page.$('input[name="field-keywords"]');
|
|
||||||
await this.set_input_value(`input[name="field-keywords"]`, keyword);
|
|
||||||
await this.sleep(50);
|
|
||||||
await input.focus();
|
|
||||||
await this.page.keyboard.press("Enter");
|
|
||||||
}
|
|
||||||
|
|
||||||
async next_page() {
|
|
||||||
let next_page_link = await this.page.$('.a-last a', {timeout: 1000});
|
|
||||||
if (!next_page_link) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
await next_page_link.click();
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
async wait_for_results() {
|
|
||||||
await this.page.waitForSelector('.s-result-list', { timeout: this.STANDARD_TIMEOUT });
|
|
||||||
}
|
|
||||||
|
|
||||||
async detected() {
|
|
||||||
const title = await this.page.title();
|
|
||||||
let html = await this.page.content();
|
|
||||||
return html.indexOf('detected unusual traffic') !== -1 || title.indexOf('/sorry/') !== -1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
module.exports = {
|
|
||||||
AmazonScraper: AmazonScraper,
|
|
||||||
};
|
|
@ -1,71 +0,0 @@
|
|||||||
const cheerio = require('cheerio');
|
|
||||||
const Scraper = require('./se_scraper');
|
|
||||||
|
|
||||||
class BaiduScraper extends Scraper {
|
|
||||||
parse(html) {
|
|
||||||
// load the page source into cheerio
|
|
||||||
const $ = cheerio.load(html);
|
|
||||||
|
|
||||||
// perform queries
|
|
||||||
const results = [];
|
|
||||||
$('#content_left .result').each((i, link) => {
|
|
||||||
results.push({
|
|
||||||
link: $(link).find('h3 a').attr('href'),
|
|
||||||
title: $(link).find('h3').text(),
|
|
||||||
snippet: $(link).find('.c-abstract').text(),
|
|
||||||
visible_link: $(link).find('.f13').text(),
|
|
||||||
})
|
|
||||||
});
|
|
||||||
|
|
||||||
const cleaned = this.clean_results(results, ['link']);
|
|
||||||
|
|
||||||
return {
|
|
||||||
time: (new Date()).toUTCString(),
|
|
||||||
no_results: false,
|
|
||||||
num_results: $('.nums_text').text(),
|
|
||||||
results: cleaned,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
async load_start_page() {
|
|
||||||
|
|
||||||
let startUrl = this.build_start_url('https://www.baidu.com/s?') || 'https://www.baidu.com/';
|
|
||||||
|
|
||||||
try {
|
|
||||||
this.last_response = await this.page.goto(startUrl);
|
|
||||||
await this.page.waitForSelector('input[name="wd"]', { timeout: 5000 });
|
|
||||||
} catch (e) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
async search_keyword(keyword) {
|
|
||||||
const input = await this.page.$('input[name="wd"]');
|
|
||||||
await this.set_input_value(`input[name="wd"]`, keyword);
|
|
||||||
await this.sleep(50);
|
|
||||||
await input.focus();
|
|
||||||
await this.page.keyboard.press("Enter");
|
|
||||||
}
|
|
||||||
|
|
||||||
async next_page() {
|
|
||||||
let next_page_link = await this.page.$('#page .n', {timeout: 5000});
|
|
||||||
if (!next_page_link) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
await next_page_link.click();
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
async wait_for_results() {
|
|
||||||
await this.page.waitForSelector('#content_left .result', { timeout: 5000 });
|
|
||||||
}
|
|
||||||
|
|
||||||
async detected() {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
module.exports = {
|
|
||||||
BaiduScraper: BaiduScraper,
|
|
||||||
};
|
|
@ -20,7 +20,7 @@ class DuckduckgoScraper extends Scraper {
|
|||||||
});
|
});
|
||||||
|
|
||||||
const ads = [];
|
const ads = [];
|
||||||
$('.results--ads.has-ad').each((i, element) => {
|
$('.results--ads .result').each((i, element) => {
|
||||||
ads.push({
|
ads.push({
|
||||||
visible_link: $(element).find('.result__url').text(),
|
visible_link: $(element).find('.result__url').text(),
|
||||||
tracking_link: $(element).find('.result__title .result__a').attr('href'),
|
tracking_link: $(element).find('.result__title .result__a').attr('href'),
|
||||||
@ -43,11 +43,11 @@ class DuckduckgoScraper extends Scraper {
|
|||||||
|
|
||||||
async load_start_page() {
|
async load_start_page() {
|
||||||
|
|
||||||
let startUrl = this.build_start_url('https://duckduckgo.com/?') || 'https://duckduckgo.com/';
|
let startUrl = 'https://duckduckgo.com/?q=test';
|
||||||
|
|
||||||
try {
|
try {
|
||||||
this.last_response = await this.page.goto(startUrl);
|
this.last_response = await this.page.goto(startUrl);
|
||||||
await this.page.waitForSelector('input[name="q"]', { timeout: 5000 });
|
await this.page.waitForSelector('input[name="q"]', { timeout: this.STANDARD_TIMEOUT });
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -63,13 +63,13 @@ class DuckduckgoScraper extends Scraper {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async next_page() {
|
async next_page() {
|
||||||
let next_page_link = await this.page.$('.result.result--more', {timeout: 5000});
|
let next_page_link = await this.page.$('.result.result--more', {timeout: this.STANDARD_TIMEOUT});
|
||||||
if (!next_page_link) {
|
if (!next_page_link) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
await next_page_link.click();
|
await next_page_link.click();
|
||||||
try {
|
try {
|
||||||
await this.page.waitForNavigation({timeout: 5000});
|
await this.page.waitForNavigation({timeout: this.STANDARD_TIMEOUT});
|
||||||
} catch(e) {
|
} catch(e) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -78,82 +78,7 @@ class DuckduckgoScraper extends Scraper {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async wait_for_results() {
|
async wait_for_results() {
|
||||||
await this.page.waitForSelector('.result__body', { timeout: 5000 });
|
await this.page.waitForSelector('.result__body', { timeout: this.STANDARD_TIMEOUT });
|
||||||
}
|
|
||||||
|
|
||||||
async detected() {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
class DuckduckgoNewsScraper extends Scraper {
|
|
||||||
|
|
||||||
parse(html) {
|
|
||||||
// load the page source into cheerio
|
|
||||||
const $ = cheerio.load(html);
|
|
||||||
|
|
||||||
// perform queries
|
|
||||||
const results = [];
|
|
||||||
$('.result--news').each((i, link) => {
|
|
||||||
results.push({
|
|
||||||
link: $(link).find('.result__title .result__a').attr('href'),
|
|
||||||
title: $(link).find('.result__title .result__a').text(),
|
|
||||||
date: $(link).find('.result__timestamp').text(),
|
|
||||||
snippet: $(link).find('.result__snippet').text(),
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
const cleaned = [];
|
|
||||||
for (var i=0; i < results.length; i++) {
|
|
||||||
let res = results[i];
|
|
||||||
if (res.link && res.link.trim() && res.title && res.title.trim()) {
|
|
||||||
res.rank = this.result_rank++;
|
|
||||||
cleaned.push(res);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return {
|
|
||||||
time: (new Date()).toUTCString(),
|
|
||||||
results: cleaned
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
async load_start_page() {
|
|
||||||
try {
|
|
||||||
this.last_response = await this.page.goto('https://duckduckgo.com/?q=42&t=h_&iar=news&ia=news');
|
|
||||||
await this.page.waitForSelector('input[name="q"]', { timeout: 5000 });
|
|
||||||
} catch (e) {
|
|
||||||
console.error(e);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
async search_keyword(keyword) {
|
|
||||||
const input = await this.page.$('input[name="q"]');
|
|
||||||
await this.set_input_value(`input[name="q"]`, keyword);
|
|
||||||
await this.sleep(50);
|
|
||||||
await input.focus();
|
|
||||||
await this.page.keyboard.press("Enter");
|
|
||||||
}
|
|
||||||
|
|
||||||
async next_page() {
|
|
||||||
let next_page_link = await this.page.$('.sb_pagN', {timeout: 1000});
|
|
||||||
if (!next_page_link) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
await next_page_link.click();
|
|
||||||
try {
|
|
||||||
this.last_response = await this.page.waitForNavigation({timeout: 5000});
|
|
||||||
} catch(e) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
async wait_for_results() {
|
|
||||||
await this.page.waitForSelector('.result--news', { timeout: 5000 });
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async detected() {
|
async detected() {
|
||||||
@ -161,6 +86,5 @@ class DuckduckgoNewsScraper extends Scraper {
|
|||||||
}
|
}
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
DuckduckgoNewsScraper: DuckduckgoNewsScraper,
|
|
||||||
DuckduckgoScraper: DuckduckgoScraper,
|
DuckduckgoScraper: DuckduckgoScraper,
|
||||||
};
|
};
|
@ -1,210 +0,0 @@
|
|||||||
const cheerio = require('cheerio');
|
|
||||||
const Scraper = require('./se_scraper');
|
|
||||||
|
|
||||||
class YahooFinanceScraper extends Scraper {
|
|
||||||
|
|
||||||
parse(html) {
|
|
||||||
// load the page source into cheerio
|
|
||||||
const $ = cheerio.load(html);
|
|
||||||
|
|
||||||
const results = [];
|
|
||||||
$('.js-stream-content .Cf').each((i, link) => {
|
|
||||||
results.push({
|
|
||||||
link: $(link).find('h3 a').attr('href'),
|
|
||||||
title: $(link).find('h3').text(),
|
|
||||||
snippet: $(link).find('p').text(),
|
|
||||||
})
|
|
||||||
});
|
|
||||||
|
|
||||||
return {
|
|
||||||
time: (new Date()).toUTCString(),
|
|
||||||
results: results,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
async load_start_page() {
|
|
||||||
try {
|
|
||||||
await this.page.goto('https://finance.yahoo.com/');
|
|
||||||
for (var i = 0; i < 3; i++) {
|
|
||||||
let consent = await this.page.waitForSelector('[type="submit"]');
|
|
||||||
await consent.click();
|
|
||||||
}
|
|
||||||
} catch (e) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
async search_keyword(keyword) {
|
|
||||||
await this.page.goto(`https://finance.yahoo.com/quote/${keyword}/news?p=${keyword}`);
|
|
||||||
await this.page.waitForSelector('#quote-header-info', { timeout: 8000 });
|
|
||||||
}
|
|
||||||
|
|
||||||
async next_page() {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
async wait_for_results() {
|
|
||||||
await this.page.waitForSelector('#b_content', { timeout: 5000 });
|
|
||||||
}
|
|
||||||
|
|
||||||
async detected() {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
class MarketwatchFinanceScraper extends Scraper {
|
|
||||||
|
|
||||||
async parse_async(html) {
|
|
||||||
let res = await this.page.evaluate(() => {
|
|
||||||
let results = [];
|
|
||||||
// get the hotel elements
|
|
||||||
let items = document.querySelectorAll('.article__content');
|
|
||||||
// get the hotel data
|
|
||||||
items.forEach((newsitem) => {
|
|
||||||
let data = {};
|
|
||||||
try {
|
|
||||||
data.link = newsitem.querySelector('.article__headline a').getAttribute('href');
|
|
||||||
data.title = newsitem.querySelector('.article__headline a').innerText;
|
|
||||||
data.date = newsitem.querySelector('.article__timestamp').innerText;
|
|
||||||
data.author = newsitem.querySelector('.article__author').innerText;
|
|
||||||
}
|
|
||||||
catch (exception) {
|
|
||||||
console.error('Error parsing marketwatch data: ', exception);
|
|
||||||
}
|
|
||||||
results.push(data);
|
|
||||||
});
|
|
||||||
return results;
|
|
||||||
});
|
|
||||||
|
|
||||||
return {
|
|
||||||
time: (new Date()).toUTCString(),
|
|
||||||
results: res,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
async load_start_page() {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
async search_keyword(keyword) {
|
|
||||||
await this.page.goto(`https://www.marketwatch.com/investing/stock/${keyword}`);
|
|
||||||
}
|
|
||||||
|
|
||||||
async next_page() {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
async wait_for_results() {
|
|
||||||
await this.page.waitForSelector('.intraday__data', { timeout: 8000 });
|
|
||||||
}
|
|
||||||
|
|
||||||
async detected() {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
class ReutersFinanceScraper extends Scraper {
|
|
||||||
|
|
||||||
async parse_async(html) {
|
|
||||||
let newsData = await this.page.evaluate(() => {
|
|
||||||
let results = [];
|
|
||||||
// get the hotel elements
|
|
||||||
let items = document.querySelectorAll('div.feature');
|
|
||||||
// get the hotel data
|
|
||||||
items.forEach((newsitem) => {
|
|
||||||
let data = {};
|
|
||||||
try {
|
|
||||||
data.link = newsitem.querySelector('h2 a').getAttribute('href');
|
|
||||||
data.link = 'https://www.reuters.com' + data.link;
|
|
||||||
data.title = newsitem.querySelector('h2 a').innerText;
|
|
||||||
data.snippet = newsitem.querySelector('p').innerText;
|
|
||||||
data.date = newsitem.querySelector('.timestamp').innerText;
|
|
||||||
}
|
|
||||||
catch (exception) {
|
|
||||||
console.error('Error parsing reuters data: ', exception);
|
|
||||||
}
|
|
||||||
results.push(data);
|
|
||||||
});
|
|
||||||
return results;
|
|
||||||
});
|
|
||||||
|
|
||||||
return {
|
|
||||||
time: (new Date()).toUTCString(),
|
|
||||||
results: newsData,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
async load_start_page() {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
async search_keyword(keyword) {
|
|
||||||
await this.page.goto(`https://www.reuters.com/finance/stocks/overview/${keyword}`);
|
|
||||||
}
|
|
||||||
|
|
||||||
async next_page() {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
async wait_for_results() {
|
|
||||||
await this.page.waitForSelector('#sectionHeader', { timeout: 8000 });
|
|
||||||
}
|
|
||||||
|
|
||||||
async detected() {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
class CnbcFinanceScraper extends Scraper {
|
|
||||||
|
|
||||||
async parse_async(html) {
|
|
||||||
let newsData = await this.page.evaluate(() => {
|
|
||||||
let results = [];
|
|
||||||
// get the hotel elements
|
|
||||||
let items = document.querySelectorAll('div.headline');
|
|
||||||
// get the hotel data
|
|
||||||
items.forEach((newsitem) => {
|
|
||||||
let data = {};
|
|
||||||
try {
|
|
||||||
data.link = newsitem.querySelector('a').getAttribute('href');
|
|
||||||
data.title = newsitem.querySelector('[ng-bind="asset.headline"]').innerText;
|
|
||||||
data.date = newsitem.querySelector('span.note').innerText;
|
|
||||||
}
|
|
||||||
catch (exception) {
|
|
||||||
console.error('Error parsing cnbc data: ', exception);
|
|
||||||
}
|
|
||||||
results.push(data);
|
|
||||||
});
|
|
||||||
return results;
|
|
||||||
});
|
|
||||||
|
|
||||||
return {
|
|
||||||
time: (new Date()).toUTCString(),
|
|
||||||
results: newsData,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
async load_start_page() {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
async search_keyword(keyword) {
|
|
||||||
await this.page.goto(`https://www.cnbc.com/quotes/?symbol=${keyword}&tab=news`);
|
|
||||||
}
|
|
||||||
|
|
||||||
async next_page() {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
async wait_for_results() {
|
|
||||||
await this.page.waitForSelector('#quote_title_and_chart', { timeout: 8000 });
|
|
||||||
}
|
|
||||||
|
|
||||||
async detected() {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
module.exports = {
|
|
||||||
YahooFinanceScraper: YahooFinanceScraper,
|
|
||||||
ReutersFinanceScraper: ReutersFinanceScraper,
|
|
||||||
CnbcFinanceScraper: CnbcFinanceScraper,
|
|
||||||
MarketwatchFinanceScraper: MarketwatchFinanceScraper,
|
|
||||||
};
|
|
111
src/modules/yandex.js
Normal file
@ -0,0 +1,111 @@
|
|||||||
|
'use strict';
|
||||||
|
|
||||||
|
const Scraper = require('./se_scraper');
|
||||||
|
const common = require('./common.js');
|
||||||
|
var log = common.log;
|
||||||
|
|
||||||
|
class YandexScraper extends Scraper {
|
||||||
|
|
||||||
|
constructor(...args) {
|
||||||
|
super(...args);
|
||||||
|
}
|
||||||
|
|
||||||
|
async parse_async(html) {
|
||||||
|
|
||||||
|
let results = await this.page.evaluate(() => {
|
||||||
|
let serp_items = document.querySelectorAll('.serp-item');
|
||||||
|
const data = [];
|
||||||
|
serp_items.forEach((item) => {
|
||||||
|
let obj = {
|
||||||
|
is_ad: false,
|
||||||
|
};
|
||||||
|
try {
|
||||||
|
if (item) {
|
||||||
|
|
||||||
|
let linkElement = item.querySelector('a.link');
|
||||||
|
|
||||||
|
if (linkElement) {
|
||||||
|
obj.link = linkElement.getAttribute('href');
|
||||||
|
obj.title = linkElement.innerText;
|
||||||
|
|
||||||
|
let label = linkElement.querySelector('.organic__subtitle .label');
|
||||||
|
|
||||||
|
if (label) {
|
||||||
|
let labelText = label.innerText;
|
||||||
|
if (labelText.trim() === 'ad') {
|
||||||
|
obj.is_ad = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
obj.snippet = item.querySelector('.text-container.typo').innerText;
|
||||||
|
obj.visible_link = item.querySelector('.typo_type_greenurl').innerText;
|
||||||
|
|
||||||
|
if (obj.title) {
|
||||||
|
data.push(obj);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return data;
|
||||||
|
});
|
||||||
|
|
||||||
|
let num_results = await this.page.evaluate(() => {
|
||||||
|
let num_results = document.querySelector('.serp-adv__found');
|
||||||
|
if (num_results) {
|
||||||
|
return num_results.innerText;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
const cleaned = this.clean_results(results, ['title', 'link' , 'snippet']);
|
||||||
|
|
||||||
|
return {
|
||||||
|
time: (new Date()).toUTCString(),
|
||||||
|
num_results: num_results,
|
||||||
|
results: cleaned,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
async load_start_page() {
|
||||||
|
let startUrl = 'https://yandex.com';
|
||||||
|
|
||||||
|
log(this.config, 1, 'Using startUrl: ' + startUrl);
|
||||||
|
|
||||||
|
this.last_response = await this.page.goto(startUrl);
|
||||||
|
|
||||||
|
await this.page.waitForSelector('input[name="text"]', { timeout: this.STANDARD_TIMEOUT });
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
async search_keyword(keyword) {
|
||||||
|
const input = await this.page.$('input[name="text"]');
|
||||||
|
await this.set_input_value(`input[name="text"]`, keyword);
|
||||||
|
await this.sleep(50);
|
||||||
|
await input.focus();
|
||||||
|
await this.page.keyboard.press("Enter");
|
||||||
|
}
|
||||||
|
|
||||||
|
async next_page() {
|
||||||
|
let next_page_link = await this.page.$('.pager .pager__item_kind_next', {timeout: 1000});
|
||||||
|
if (!next_page_link) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
await next_page_link.click();
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
async wait_for_results() {
|
||||||
|
await this.page.waitForSelector('.main__content', { timeout: this.STANDARD_TIMEOUT });
|
||||||
|
}
|
||||||
|
|
||||||
|
async detected() {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
YandexScraper: YandexScraper,
|
||||||
|
};
|
@ -1,103 +0,0 @@
|
|||||||
const cheerio = require('cheerio');
|
|
||||||
const Scraper = require('./se_scraper');
|
|
||||||
|
|
||||||
class YoutubeScraper extends Scraper {
|
|
||||||
|
|
||||||
parse(html) {
|
|
||||||
// load the page source into cheerio
|
|
||||||
const $ = cheerio.load(html);
|
|
||||||
|
|
||||||
// perform queries
|
|
||||||
const results = [];
|
|
||||||
$('#contents ytd-video-renderer,#contents ytd-grid-video-renderer').each((i, link) => {
|
|
||||||
results.push({
|
|
||||||
link: $(link).find('#video-title').attr('href'),
|
|
||||||
title: $(link).find('#video-title').text(),
|
|
||||||
snippet: $(link).find('#description-text').text(),
|
|
||||||
channel: $(link).find('#byline a').text(),
|
|
||||||
channel_link: $(link).find('#byline a').attr('href'),
|
|
||||||
num_views: $(link).find('#metadata-line span:nth-child(1)').text(),
|
|
||||||
release_date: $(link).find('#metadata-line span:nth-child(2)').text(),
|
|
||||||
})
|
|
||||||
});
|
|
||||||
|
|
||||||
let no_results = this.no_results(
|
|
||||||
['No results found', 'Keine Ergebnisse', 'Es werden Ergebnisse angezeigt', 'Showing results for' ],
|
|
||||||
$('yt-showing-results-for-renderer').text()
|
|
||||||
);
|
|
||||||
|
|
||||||
let effective_query = $('#corrected-link').text() || '';
|
|
||||||
|
|
||||||
const cleaned = [];
|
|
||||||
for (var i=0; i < results.length; i++) {
|
|
||||||
let res = results[i];
|
|
||||||
if (res.link && res.link.trim() && res.title && res.title.trim()) {
|
|
||||||
res.title = res.title.trim();
|
|
||||||
res.snippet = res.snippet.trim();
|
|
||||||
res.rank = this.result_rank++;
|
|
||||||
|
|
||||||
// check if this result has been used before
|
|
||||||
if (this.all_videos.has(res.title) === false) {
|
|
||||||
cleaned.push(res);
|
|
||||||
}
|
|
||||||
this.all_videos.add(res.title);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return {
|
|
||||||
time: (new Date()).toUTCString(),
|
|
||||||
no_results: no_results,
|
|
||||||
effective_query: effective_query,
|
|
||||||
num_results: '',
|
|
||||||
results: cleaned,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
async load_start_page() {
|
|
||||||
try {
|
|
||||||
this.all_videos = new Set();
|
|
||||||
this.last_response = await this.page.goto('https://www.youtube.com', {
|
|
||||||
referer: 'https://google.com'
|
|
||||||
});
|
|
||||||
await this.page.waitForSelector('input[id="search"]', { timeout: 5000 });
|
|
||||||
// before we do anything, parse the results of the front page of youtube
|
|
||||||
await this.page.waitForSelector('ytd-video-renderer,ytd-grid-video-renderer', { timeout: 10000 });
|
|
||||||
let html = await this.page.content();
|
|
||||||
this.results['frontpage'] = this.parse(html);
|
|
||||||
this.result_rank = 1;
|
|
||||||
} catch(e) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
async search_keyword(keyword) {
|
|
||||||
const input = await this.page.$('input[id="search"]');
|
|
||||||
// overwrites last text in input
|
|
||||||
await input.click({ clickCount: 3 });
|
|
||||||
await input.type(keyword);
|
|
||||||
await input.focus();
|
|
||||||
await this.page.keyboard.press("Enter");
|
|
||||||
}
|
|
||||||
|
|
||||||
async next_page() {
|
|
||||||
// youtube needs scrolling
|
|
||||||
// TODO: implement scrolling, no priority right now
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
async wait_for_results() {
|
|
||||||
await this.page.waitForFunction(`document.title.indexOf('${this.keyword}') !== -1`, { timeout: 5000 });
|
|
||||||
await this.page.waitForSelector('ytd-video-renderer,ytd-grid-video-renderer', { timeout: 5000 });
|
|
||||||
}
|
|
||||||
|
|
||||||
async detected() {
|
|
||||||
const title = await this.page.title();
|
|
||||||
let html = await this.page.content();
|
|
||||||
return html.indexOf('detected unusual traffic') !== -1 || title.indexOf('/sorry/') !== -1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
module.exports = {
|
|
||||||
YoutubeScraper: YoutubeScraper,
|
|
||||||
};
|
|
@ -5,13 +5,10 @@ var os = require("os");
|
|||||||
|
|
||||||
const UserAgent = require('user-agents');
|
const UserAgent = require('user-agents');
|
||||||
const google = require('./modules/google.js');
|
const google = require('./modules/google.js');
|
||||||
const amazon = require('./modules/amazon.js');
|
|
||||||
const bing = require('./modules/bing.js');
|
const bing = require('./modules/bing.js');
|
||||||
const baidu = require('./modules/baidu.js');
|
const yandex = require('./modules/yandex.js');
|
||||||
const infospace = require('./modules/infospace.js');
|
const infospace = require('./modules/infospace.js');
|
||||||
const youtube = require('./modules/youtube.js');
|
|
||||||
const duckduckgo = require('./modules/duckduckgo.js');
|
const duckduckgo = require('./modules/duckduckgo.js');
|
||||||
const tickersearch = require('./modules/ticker_search.js');
|
|
||||||
const { Cluster } = require('./puppeteer-cluster/dist/index.js');
|
const { Cluster } = require('./puppeteer-cluster/dist/index.js');
|
||||||
const common = require('./modules/common.js');
|
const common = require('./modules/common.js');
|
||||||
var log = common.log;
|
var log = common.log;
|
||||||
@ -42,21 +39,12 @@ function getScraper(search_engine, args) {
|
|||||||
google_news_old: google.GoogleNewsOldScraper,
|
google_news_old: google.GoogleNewsOldScraper,
|
||||||
google_news: google.GoogleNewsScraper,
|
google_news: google.GoogleNewsScraper,
|
||||||
google_image: google.GoogleImageScraper,
|
google_image: google.GoogleImageScraper,
|
||||||
google_maps: google.GoogleMapsScraper,
|
|
||||||
google_shopping: google.GoogleShoppingScraper,
|
|
||||||
bing: bing.BingScraper,
|
bing: bing.BingScraper,
|
||||||
|
yandex: yandex.YandexScraper,
|
||||||
bing_news: bing.BingNewsScraper,
|
bing_news: bing.BingNewsScraper,
|
||||||
amazon: amazon.AmazonScraper,
|
|
||||||
duckduckgo: duckduckgo.DuckduckgoScraper,
|
duckduckgo: duckduckgo.DuckduckgoScraper,
|
||||||
duckduckgo_news: duckduckgo.DuckduckgoNewsScraper,
|
|
||||||
infospace: infospace.InfospaceScraper,
|
infospace: infospace.InfospaceScraper,
|
||||||
webcrawler: infospace.WebcrawlerNewsScraper,
|
webcrawler: infospace.WebcrawlerNewsScraper,
|
||||||
baidu: baidu.BaiduScraper,
|
|
||||||
youtube: youtube.YoutubeScraper,
|
|
||||||
yahoo_news: tickersearch.YahooFinanceScraper,
|
|
||||||
reuters: tickersearch.ReutersFinanceScraper,
|
|
||||||
cnbc: tickersearch.CnbcFinanceScraper,
|
|
||||||
marketwatch: tickersearch.MarketwatchFinanceScraper,
|
|
||||||
}[search_engine](args);
|
}[search_engine](args);
|
||||||
} else if (typeof search_engine === 'function') {
|
} else if (typeof search_engine === 'function') {
|
||||||
return new search_engine(args);
|
return new search_engine(args);
|
||||||
|
@ -29,6 +29,11 @@ async function bing_ads() {
|
|||||||
|
|
||||||
bing_search_with_ads2( await scraper.scrape(scrape_config) );
|
bing_search_with_ads2( await scraper.scrape(scrape_config) );
|
||||||
|
|
||||||
|
scrape_config.keywords = ['car tires cheap'];
|
||||||
|
scrape_config.scrape_from_file = 'file://' + path.join(__dirname, './html/bing3.html');
|
||||||
|
|
||||||
|
bing_search_with_ads3( await scraper.scrape(scrape_config) );
|
||||||
|
|
||||||
await scraper.quit();
|
await scraper.quit();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -86,6 +91,32 @@ function bing_search_with_ads2(response) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function bing_search_with_ads3(response) {
|
||||||
|
assert.equal(response.metadata.num_requests, 1);
|
||||||
|
|
||||||
|
for (let query in response.results) {
|
||||||
|
|
||||||
|
for (let page_number in response.results[query]) {
|
||||||
|
|
||||||
|
assert.isNumber(parseInt(page_number), 'page_number must be numeric');
|
||||||
|
|
||||||
|
let obj = response.results[query][page_number];
|
||||||
|
|
||||||
|
assert.include(obj.num_results, '65.500.000 results', 'num results not included');
|
||||||
|
assert.containsAllKeys(obj, ['results', 'time', 'no_results', 'num_results', 'effective_query', 'ads'], 'not all keys are in the object');
|
||||||
|
assert.isAtLeast(obj.results.length, 10, 'results must have at least 10 SERP objects');
|
||||||
|
assert.isAtLeast(obj.ads.length, 3, 'there are 3 ads');
|
||||||
|
|
||||||
|
assert.equal(obj.no_results, false, 'no results should be false');
|
||||||
|
assert.typeOf(obj.num_results, 'string', 'num_results must be a string');
|
||||||
|
assert.isAtLeast(obj.num_results.length, 5, 'num_results should be a string of at least 5 chars');
|
||||||
|
assert.typeOf(Date.parse(obj.time), 'number', 'time should be a valid date');
|
||||||
|
|
||||||
|
confirm_results_ok(obj);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
function confirm_results_ok(obj) {
|
function confirm_results_ok(obj) {
|
||||||
|
|
||||||
@ -102,7 +133,7 @@ function confirm_results_ok(obj) {
|
|||||||
|
|
||||||
assert.isOk(res.title, 'title must be ok');
|
assert.isOk(res.title, 'title must be ok');
|
||||||
assert.typeOf(res.title, 'string', 'title must be string');
|
assert.typeOf(res.title, 'string', 'title must be string');
|
||||||
assert.isAtLeast(res.title.length, 10, 'title must have at least 10 chars');
|
assert.isAtLeast(res.title.length, 8, 'title must have at least 8 chars');
|
||||||
|
|
||||||
assert.isOk(res.snippet, 'snippet must be ok');
|
assert.isOk(res.snippet, 'snippet must be ok');
|
||||||
assert.typeOf(res.snippet, 'string', 'snippet must be string');
|
assert.typeOf(res.snippet, 'string', 'snippet must be string');
|
||||||
@ -123,7 +154,7 @@ function confirm_results_ok(obj) {
|
|||||||
|
|
||||||
assert.isOk(res.title, 'title must be ok');
|
assert.isOk(res.title, 'title must be ok');
|
||||||
assert.typeOf(res.title, 'string', 'title must be string');
|
assert.typeOf(res.title, 'string', 'title must be string');
|
||||||
assert.isAtLeast(res.title.length, 10, 'title must have at least 10 chars');
|
assert.isAtLeast(res.title.length, 8, 'title must have at least 8 chars');
|
||||||
|
|
||||||
assert.isOk(res.snippet, 'snippet must be ok');
|
assert.isOk(res.snippet, 'snippet must be ok');
|
||||||
assert.typeOf(res.snippet, 'string', 'snippet must be string');
|
assert.typeOf(res.snippet, 'string', 'snippet must be string');
|
||||||
|
99
test/static_tests/duckduckgo.js
Normal file
@ -0,0 +1,99 @@
|
|||||||
|
const se_scraper = require('./../../index.js');
|
||||||
|
const chai = require('chai');
|
||||||
|
chai.use(require('chai-string'));
|
||||||
|
const assert = chai.assert;
|
||||||
|
const path = require('path');
|
||||||
|
|
||||||
|
async function duckduckgo() {
|
||||||
|
let config = {
|
||||||
|
compress: false,
|
||||||
|
debug_level: 1,
|
||||||
|
headless: true,
|
||||||
|
};
|
||||||
|
|
||||||
|
let scrape_config = {
|
||||||
|
search_engine: 'duckduckgo',
|
||||||
|
keywords: ['cloud service'],
|
||||||
|
num_pages: 1,
|
||||||
|
scrape_from_file: 'file://' + path.join(__dirname, './html/duckduckgo1.html'),
|
||||||
|
};
|
||||||
|
|
||||||
|
var scraper = new se_scraper.ScrapeManager(config);
|
||||||
|
|
||||||
|
await scraper.start();
|
||||||
|
|
||||||
|
duckduckgo_normal( await scraper.scrape(scrape_config) );
|
||||||
|
|
||||||
|
await scraper.quit();
|
||||||
|
}
|
||||||
|
|
||||||
|
function duckduckgo_normal(response) {
|
||||||
|
assert.equal(response.metadata.num_requests, 1);
|
||||||
|
|
||||||
|
for (let query in response.results) {
|
||||||
|
|
||||||
|
for (let page_number in response.results[query]) {
|
||||||
|
|
||||||
|
assert.isNumber(parseInt(page_number), 'page_number must be numeric');
|
||||||
|
|
||||||
|
let obj = response.results[query][page_number];
|
||||||
|
|
||||||
|
assert.containsAllKeys(obj, ['results', 'time', 'ads',], 'not all keys are in the object');
|
||||||
|
assert.isAtLeast(obj.results.length, 10, 'results must have at least 10 SERP objects');
|
||||||
|
assert.isAtLeast(obj.ads.length, 2, 'ads must have at least 2 SERP objects');
|
||||||
|
|
||||||
|
assert.typeOf(Date.parse(obj.time), 'number', 'time should be a valid date');
|
||||||
|
|
||||||
|
confirm_results_ok(obj);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function confirm_results_ok(obj) {
|
||||||
|
|
||||||
|
for (let res of obj.results) {
|
||||||
|
assert.containsAllKeys(res, ['link', 'title', 'rank', 'visible_link', 'snippet'], 'not all keys are in the SERP object');
|
||||||
|
|
||||||
|
assert.isOk(res.link, 'link must be ok');
|
||||||
|
assert.typeOf(res.link, 'string', 'link must be string');
|
||||||
|
assert.isAtLeast(res.link.length, 5, 'link must have at least 5 chars');
|
||||||
|
|
||||||
|
assert.isOk(res.visible_link, 'visible_link must be ok');
|
||||||
|
assert.typeOf(res.visible_link, 'string', 'visible_link must be string');
|
||||||
|
assert.isAtLeast(res.visible_link.length, 5, 'visible_link must have at least 5 chars');
|
||||||
|
|
||||||
|
assert.isOk(res.title, 'title must be ok');
|
||||||
|
assert.typeOf(res.title, 'string', 'title must be string');
|
||||||
|
assert.isAtLeast(res.title.length, 10, 'title must have at least 10 chars');
|
||||||
|
|
||||||
|
assert.isOk(res.snippet, 'snippet must be ok');
|
||||||
|
assert.typeOf(res.snippet, 'string', 'snippet must be string');
|
||||||
|
assert.isAtLeast(res.snippet.length, 10, 'snippet must have at least 10 chars');
|
||||||
|
|
||||||
|
assert.isNumber(res.rank, 'rank must be integer');
|
||||||
|
}
|
||||||
|
|
||||||
|
for (let res of obj.ads) {
|
||||||
|
|
||||||
|
assert.isOk(res.tracking_link, 'link must be ok');
|
||||||
|
assert.typeOf(res.tracking_link, 'string', 'link must be string');
|
||||||
|
assert.isAtLeast(res.tracking_link.length, 5, 'link must have at least 5 chars');
|
||||||
|
|
||||||
|
assert.isOk(res.visible_link, 'link must be ok');
|
||||||
|
assert.typeOf(res.visible_link, 'string', 'link must be string');
|
||||||
|
assert.isAtLeast(res.visible_link.length, 5, 'link must have at least 5 chars');
|
||||||
|
|
||||||
|
assert.isOk(res.title, 'title must be ok');
|
||||||
|
assert.typeOf(res.title, 'string', 'title must be string');
|
||||||
|
assert.isAtLeast(res.title.length, 10, 'title must have at least 10 chars');
|
||||||
|
|
||||||
|
assert.isOk(res.snippet, 'snippet must be ok');
|
||||||
|
assert.typeOf(res.snippet, 'string', 'snippet must be string');
|
||||||
|
assert.isAtLeast(res.snippet.length, 10, 'snippet must have at least 10 chars');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
describe('Duckduckgo', function(){
|
||||||
|
this.timeout(10000);
|
||||||
|
it('static duckduckgo sarch', duckduckgo);
|
||||||
|
});
|
@ -44,6 +44,11 @@ async function normal_search_test() {
|
|||||||
|
|
||||||
right_side_info_text2( await scraper.scrape(scrape_config) );
|
right_side_info_text2( await scraper.scrape(scrape_config) );
|
||||||
|
|
||||||
|
scrape_config.scrape_from_file = 'file://' + path.join(__dirname, './html/google6.html');
|
||||||
|
scrape_config.keywords = ['car tires for sale'];
|
||||||
|
|
||||||
|
google_places_and_ads( await scraper.scrape(scrape_config) );
|
||||||
|
|
||||||
await scraper.quit();
|
await scraper.quit();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -198,6 +203,36 @@ function right_side_info_text2(response) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function google_places_and_ads(response) {
|
||||||
|
assert.equal(response.metadata.num_requests, 1);
|
||||||
|
|
||||||
|
for (let query in response.results) {
|
||||||
|
|
||||||
|
for (let page_number in response.results[query]) {
|
||||||
|
|
||||||
|
assert.isNumber(parseInt(page_number), 'page_number must be numeric');
|
||||||
|
|
||||||
|
let obj = response.results[query][page_number];
|
||||||
|
|
||||||
|
assert.include(obj.num_results, '439.000.000 Ergebnisse (0,64 Sekunden)', 'num results not included');
|
||||||
|
assert.containsAllKeys(obj, ['results', 'time', 'no_results', 'num_results', 'effective_query', 'top_ads', 'bottom_ads', 'places'], 'not all keys are in the object');
|
||||||
|
assert.isAtLeast(obj.results.length, 10, 'results must have at least 10 SERP objects');
|
||||||
|
assert.equal(obj.top_ads.length, 0, 'there are no top ads');
|
||||||
|
assert.equal(obj.bottom_ads.length, 0, 'there are 0 bottom ads');
|
||||||
|
assert.isAtLeast(obj.top_products.length, 13, 'there are 13 top products');
|
||||||
|
assert.equal(obj.right_products.length, 0, 'there are 0 right products');
|
||||||
|
assert.equal(obj.places.length, 2, 'there are 2 places');
|
||||||
|
|
||||||
|
assert.equal(obj.no_results, false, 'no results should be false');
|
||||||
|
assert.typeOf(obj.num_results, 'string', 'num_results must be a string');
|
||||||
|
assert.isAtLeast(obj.num_results.length, 5, 'num_results should be a string of at least 5 chars');
|
||||||
|
assert.typeOf(Date.parse(obj.time), 'number', 'time should be a valid date');
|
||||||
|
|
||||||
|
confirm_results_ok(obj);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
function confirm_results_ok(obj) {
|
function confirm_results_ok(obj) {
|
||||||
|
|
||||||
|
97
test/static_tests/html/bing3.html
Normal file
1
test/static_tests/html/bing3_files/03c2b45e.js
Normal file
1
test/static_tests/html/bing3_files/08f37d2d.js
Normal file
1
test/static_tests/html/bing3_files/0b96ff77.css
Normal file
@ -0,0 +1 @@
|
|||||||
|
.MicrosoftMap .MapsInfoboxContainer{display:-ms-inline-flexbox;display:inline-flex;max-width:290px;font:13px Arial,Helvetica,Sans-Serif;color:#666 !important;background-color:#fff;border-radius:2px;-moz-box-shadow:0 0 0 1px rgba(0,0,0,.05),0 2px 4px 0 rgba(0,0,0,.14);-webkit-box-shadow:0 0 0 1px rgba(0,0,0,.05),0 2px 4px 0 rgba(0,0,0,.14);box-shadow:0 0 0 1px rgba(0,0,0,.05),0 2px 4px 0 rgba(0,0,0,.14)}.MicrosoftMap .InfoboxCustom .infoBoxLink{display:flex;text-decoration:none;color:#666;cursor:default}.MicrosoftMap .InfoboxCustom .MapsInfoboxContainer sd{display:flex}.MicrosoftMap .InfoboxCustom .MapsInfoboxContainer .bm_ib_imageContainer{max-width:80px;height:auto;min-height:80px;margin:0;padding:0;display:flex;display:-ms-flexbox;flex-direction:column;-ms-flex-direction:column;justify-content:center;-ms-flex-pack:center;background-color:#cecece}.MicrosoftMap .InfoboxCustom .MapsInfoboxContainer .bm_ib_imageContainer .bm_ib_image{width:80px}.MicrosoftMap.TravelOverlay .InfoboxCustom .MapsInfoboxContainer .bm_ib_imageContainer .bm_ib_image{height:auto;width:80px}.MicrosoftMap .InfoboxCustom .MapsInfoboxContainer .bm_ib_container{width:auto;padding:12px 16px 12px 12px;max-width:210px}.MicrosoftMap .InfoboxCustom .infoBoxLink:hover,.MicrosoftMap .InfoboxCustom .infoBoxLink:focus,.MicrosoftMap .InfoboxCustom .infoBoxLink .lMCard:hover,.MicrosoftMap .InfoboxCustom .infoBoxLink .lMCard:focus{background-color:#ebf6ff}.MicrosoftMap .InfoboxCustom .MapsInfoboxContainer .bm_ib_container.bm_ib_titleonly{max-width:210px;width:auto;padding:2px 16px 0 12px;min-height:20px}.MicrosoftMap .InfoboxCustom .MapsInfoboxContainer .bm_ib_container.bm_ib_titleonly .bm_ib_title{max-width:210px}.MicrosoftMap .InfoboxCustom .MapsInfoboxContainer .bm_ib_title{font-weight:600;color:#111;width:100%;padding-bottom:4px;line-height:17px;max-height:32px;overflow:hidden;max-width:190px;text-overflow:ellipsis}.MicrosoftMap .InfoboxCustom .MapsInfoboxContainer .bm_ib_titleonly .bm_ib_title{padding-bottom:0;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.MicrosoftMap .InfoboxCustom .MapsInfoboxContainer .bm_ib_greatRatingContainer{display:flex;font-size:11px;width:100%;line-height:16px;margin:2px 0;color:#666}.MicrosoftMap .InfoboxCustom .MapsInfoboxContainer .bm_ib_greatRatingContainer .bm_ib_greatSchoolImage{padding-right:4px;height:16px;width:16px}.MicrosoftMap .InfoboxCustom .MapsInfoboxContainer .bm_ib_metadata_noImg{font-size:11px;width:100%;line-height:16px}.MicrosoftMap .InfoboxCustom .MapsInfoboxContainer .bm_ib_metadata_noImg.interest{max-width:190px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;-ms-text-overflow:ellipsis}.MicrosoftMap .InfoboxCustom .MapsInfoboxContainer .bm_ib_metadata_noImg.itinDesc{max-height:30px;overflow:hidden;text-overflow:ellipsis;-ms-text-overflow:ellipsis}.MicrosoftMap .InfoboxCustom .MapsInfoboxContainer .bm_ib_metadata_noImg.description{word-break:break-all}.MicrosoftMap .InfoboxCustom .MapsInfoboxContainer .bm_ib_metadata_noImg li{padding-bottom:0}.MicrosoftMap .InfoboxCustom .MapsInfoboxContainer .bm_ib_rate_and_price{font-size:11px;width:100%;line-height:16px}.MicrosoftMap .InfoboxCustom .MapsInfoboxContainer .bm_ib_rate_and_price .csrc.sc_rc1{vertical-align:text-bottom}.MicrosoftMap .InfoboxCustom .MapsInfoboxContainer .bm_ib_action_links{font-size:13px;border-top:1px solid #ddd;width:100%;line-height:16px}.MicrosoftMap .InfoboxCustom .MapsInfoboxContainer .csrc{padding-right:4px}
|
BIN
test/static_tests/html/bing3_files/0f3036a9.png
Normal file
After Width: | Height: | Size: 124 B |
1
test/static_tests/html/bing3_files/112287e6.css
Normal file
1
test/static_tests/html/bing3_files/19b40d8c.js
Normal file
@ -0,0 +1 @@
|
|||||||
|
function ad_pt(n){function t(n,t,i,r){Log&&Log.Log&&Log.Log(n,t,i,r)}var e="sendBeacon",i,r,f,u;if(!n){t("Ads","AdsParallelTracking","ReportLink is missing",!0);return}if(i=navigator,r=!i||!i[e],!r)try{i[e](n)}catch(o){r=!0}r?(f=!1,_w.sj_gx&&(u=sj_gx(),u&&(u.open("GET",n),u.send(),f=!0,t("Ads","AdsParallelTracking","Fallback involved",!0))),f||t("Ads","AdsParallelTracking","Fallback failed",!0)):t("Ads","AdsParallelTracking","Success",!0)}
|
1
test/static_tests/html/bing3_files/1a052ea9.js
Normal file
1
test/static_tests/html/bing3_files/1bc42c5e.css
Normal file
1
test/static_tests/html/bing3_files/1c629750.js
Normal file
1
test/static_tests/html/bing3_files/1f497ebd.js
Normal file
@ -0,0 +1 @@
|
|||||||
|
IRP=new function(){function t(){n=_d.querySelector?_d.querySelector(".irpserp"):null;n&&typeof IRH!="undefined"&&(_w.imageRichHover=new IRH,_w.imageRichHover.IsInitialized&&(_w.imageRichHover.logHover=i,_w.imageRichHover.attach(n,["a"])))}function i(n,t){if(n){t||(t="h");var i=['{"T":"CI.Hover","AppNS":"',n.ns,'","K":"',n.k,'.1","Name":"ImgAns","HType":"',t,'","TS":',sb_gt(),"}"];r(i.join(""))}}function r(n){var t=new Image,i=["/fd/ls/ls.gif?IG=",_G.IG,"&Type=Event.ClientInst&DATA=",n,"&log=UserEvent"];return t.src=i.join(""),!0}var n=null;t()}
|
BIN
test/static_tests/html/bing3_files/27090a19.gif
Normal file
After Width: | Height: | Size: 120 KiB |
1
test/static_tests/html/bing3_files/2bcc99e1.js
Normal file
1
test/static_tests/html/bing3_files/323bf41b.js
Normal file
@ -0,0 +1 @@
|
|||||||
|
var RapFeedback;(function(n){var t;(function(n){"use strict";function t(n){return n&&n.impressionGuid?n.impressionGuid.replace("{","").replace("}","").replace(/-/g,""):_G.IG}n.Provide=t})(t=n.ImpressionGuidProvider||(n.ImpressionGuidProvider={}))})(RapFeedback||(RapFeedback={}))
|
1
test/static_tests/html/bing3_files/35d5e363.css
Normal file
@ -0,0 +1 @@
|
|||||||
|
.feedbackPanel .me-overlay-listings{margin-top:15px;margin-bottom:15px}.feedbackPanel .me-overlay-listings .me-b_rich{padding-top:0}.feedbackPanel .me-overlay-listings .me-b_rich>ul.me-b_vList>li{padding-bottom:0}.feedbackPanel .me-listings-item{cursor:pointer;color:#666}.feedbackPanel .me-listings-item .me-b_factrow{color:#666}.feedbackPanel .me-listings-item{display:block;border-bottom:4px solid #f5f5f5}.feedbackPanel .me-overlay-listings .me-entity-listing-container .me-b_vList li:first-child .me-listings-item{border-top:4px solid #f5f5f5}.feedbackPanel .me-overlay-listings .me-b_vPanel{float:left;margin-top:11px;margin-left:16px;height:97px}.feedbackPanel .me-overlay-listings .me-b_vList .me-b_vPanel div{overflow:hidden;white-space:nowrap;text-overflow:ellipsis;width:235px;padding-bottom:0;font:13px 'Segoe UI',Helvetica,Arial,Sans-Serif;color:#505050}.feedbackPanel .me-overlay-listings .me-entity-listing-container,.feedbackPanel .me-overlay-listings .me-b_vPanel .me-b_factrow{margin-bottom:4px}.feedbackPanel .me-overlay-listings .me-b_vPanel>div:first-child div{font:15px 'Segoe UI',Helvetica,Arial,Sans-Serif;font-weight:500;color:#333}.feedbackPanel .me-listings-item.hover,.me-listings-item:hover,.me-listings-item:focus{background-color:#dcecf8;text-decoration:none}.feedbackPanel .me-overlay-listings .me-listings-item .me-b_imagePair.me-tall_m{float:left;padding-left:0}.feedbackPanel .me-overlay-listings .me-listings-item .me-b_imagePair.me-tall_m>div{float:left}.feedbackPanel .me-overlay-listings .me-listings-item>div:first-child:after{content:"";display:table;clear:both}.feedbackPanel .me-overlay-listings .me-listings-item .me-b_imagePair.me-tall_m>.inner{margin:0;padding:0}.feedbackPanel .feedbackDidYouMeanText{font-size:18px;color:#444;margin-top:10px;margin-left:10px}.feedbackPanel .similarBusinessOnBingText{font-size:14px;color:#767676;margin-top:10px;margin-left:10px}.feedbackPanel .meautosuggesttext{padding:15px 10px 5px 5px}
|
1
test/static_tests/html/bing3_files/37f3511b.js
Normal file
@ -0,0 +1 @@
|
|||||||
|
(function(){function t(t){typeof Log!==n&&typeof Log.Log!==n&&Log.Log("NcHeader","Rewards",t,!0)}function i(){var r,f,e;if(typeof bepcfg===n)t("bepcfg Undefined");else if(r=_ge("nc_iid"),r){var o=typeof bepcfg.wb!==n,s=typeof bepcfg.v!==n,u=r.getAttribute("_IG");if(u&&u.length||(u=_G.IG),f="&IID="+r.getAttribute("_iid")+"&IG="+u,s)try{sj_cook.get("")}catch(l){f+="&CID="+r.getAttribute("_cid")}var c="/rewardsapp/ncheader?ver="+_G.AppVer+f,h=[_w.top,_w],i=sj_gx();i.open("POST",c,!0);i.setRequestHeader("Content-type","application/x-www-form-urlencoded");o&&(i.onreadystatechange=function(){i&&i.readyState==4&&i.status==200&&sj_appHTML(sj_b,i.responseText)});e="wb="+(o?bepcfg.wb:"0");s&&(e+=";i="+(h[0]!==h[1].self?0:1)+";v="+bepcfg.v);i.send(e)}else t("nc_iid NotFound")}var n="undefined";sj_evt.bind("onHTML",function(){i()},!0,0)})()
|
1
test/static_tests/html/bing3_files/3957e8df.js
Normal file
@ -0,0 +1 @@
|
|||||||
|
var Chevrons;(function(n){function e(n,t,i){return new f(n,t,i)}var r="disabled",u="hidden",t="darkchv",i="exp",f=function(){function n(n,t,r){var u=this;this.controlId=n;this.prevSlideBtn=t;this.nextSlideBtn=r;this.onPrevClick(function(){var n="slideexp_slideprev",t="Prev",r=Lib.CssClass.contains(u.prevSlideBtn,i);r&&(Lib.CssClass.remove(u.prevSlideBtn,i),n="slideexp_expandleft",t="ExpandLeft");sj_evt.fire(n,u.controlId);Log.Log(t,"SlideExp","Chevron")});this.onNextClick(function(){var n="slideexp_slidenext",t="Next",r=Lib.CssClass.contains(u.nextSlideBtn,i);r&&(Lib.CssClass.remove(u.nextSlideBtn,i),n="slideexp_expandright",t="ExpandRight");sj_evt.fire(n,u.controlId);Log.Log(t,"SlideExp","Chevron")});this.onMouseOver(function(){sj_evt.fire("slideexp_pauseautoslide",u.controlId)});this.onMouseOut(function(){sj_evt.fire("slideexp_resumeautoslide",u.controlId)});sj_evt.bind("slideexp_leftmost",function(n){u.isForMe(n)&&(u.disablePrev(!0),u.disableNext(!1))});sj_evt.bind("slideexp_rightmost",function(n){u.isForMe(n)&&(u.disablePrev(!1),u.disableNext(!0))});sj_evt.bind("slideexp_middle",function(n){u.isForMe(n)&&(u.disablePrev(!1),u.disableNext(!1))});sj_evt.bind("slideexp_leftrightmost",function(n){u.isForMe(n)&&(u.disablePrev(!0),u.disableNext(!0))});sj_evt.bind("slideexp_mouseover_show",function(n){u.isForMe(n)&&u.show()});sj_evt.bind("slideexp_mouseout_hide",function(n){u.isForMe(n)&&u.hide()});sj_evt.bind("slideexp_mouseover_dark",function(n){u.isForMe(n)&&u.changToDark()});sj_evt.bind("slideexp_mouseout_light",function(n){u.isForMe(n)&&u.changToLight()})}return n.prototype.onPrevClick=function(n){this.prevSlideBtn!=null&&this.nextSlideBtn!=null&&n&&sj_be(this.prevSlideBtn,"click",n)},n.prototype.onNextClick=function(n){this.prevSlideBtn!=null&&this.nextSlideBtn!=null&&n&&sj_be(this.nextSlideBtn,"click",n)},n.prototype.onMouseOver=function(n){this.prevSlideBtn!=null&&this.nextSlideBtn!=null&&n&&(sj_be(this.prevSlideBtn,"mouseover",n),sj_be(this.nextSlideBtn,"mouseover",n))},n.prototype.onMouseOut=function(n){this.prevSlideBtn!=null&&this.nextSlideBtn!=null&&n&&(sj_be(this.prevSlideBtn,"mouseout",n),sj_be(this.nextSlideBtn,"mouseout",n))},n.prototype.show=function(){this.setHidden(!1)},n.prototype.changToDark=function(){this.prevSlideBtn!=null&&this.nextSlideBtn!=null&&(Lib.CssClass.add(this.prevSlideBtn,t),Lib.CssClass.add(this.nextSlideBtn,t))},n.prototype.hide=function(){this.setHidden(!0)},n.prototype.changToLight=function(){this.prevSlideBtn!=null&&this.nextSlideBtn!=null&&(Lib.CssClass.remove(this.prevSlideBtn,t),Lib.CssClass.remove(this.nextSlideBtn,t))},n.prototype.disablePrev=function(n){this.prevSlideBtn!=null&&this.updateClassIf(this.prevSlideBtn,n,r)},n.prototype.disableNext=function(n){this.nextSlideBtn!=null&&this.updateClassIf(this.nextSlideBtn,n,r)},n.prototype.setHidden=function(n){this.prevSlideBtn!=null&&this.nextSlideBtn!=null&&(this.updateClassIf(this.prevSlideBtn,n,u),this.updateClassIf(this.nextSlideBtn,n,u))},n.prototype.updateClassIf=function(n,t,i){t?Lib.CssClass.add(n,i):Lib.CssClass.remove(n,i)},n.prototype.isForMe=function(n){return n[1]===this.controlId},n}();n.init=e;sj_evt.fire("chevrons_init",f)})(Chevrons||(Chevrons={}))
|
1
test/static_tests/html/bing3_files/3ae6a067.js
Normal file
1
test/static_tests/html/bing3_files/3baa9af7.js
Normal file
@ -0,0 +1 @@
|
|||||||
|
(function(){function i(){var f="data-load",u,i;if(n&&!n.hasAttribute(f))try{if(_d.body.appendChild(n),typeof sj_gx=="function"){if(u=r.replace("%IG%",_G.IG).replace("%IID%",n.getAttribute("data-iid")).replace("%PARTNER%",n.getAttribute("data-ptn")),n.setAttribute(f,"1"),i=sj_gx(),!i)return null;i.onreadystatechange=function(){typeof sj_appHTML=="function"&&4==i.readyState&&200==i.status&&sj_appHTML(n,i.responseText)};i.open("GET",t?SbiTst.at(u):u,!0);i.send(null)}}catch(e){}}function u(){if(n){var r=n.getAttribute("data-evt");r&&!t?sj_evt.bind(r,i,!0):i()}}var r="/images/sbi?mmasync=1&ig=%IG%&iid=%IID%&ptn=%PARTNER%",n=_ge("sbicom_loader"),t=typeof SbiTst!="undefined";u()})()
|
1
test/static_tests/html/bing3_files/3da3bce8.js
Normal file
BIN
test/static_tests/html/bing3_files/3e2b0220.jpg
Normal file
After Width: | Height: | Size: 14 KiB |
1
test/static_tests/html/bing3_files/40e1b425.js
Normal file
@ -0,0 +1 @@
|
|||||||
|
var wln=wln||"",Identity;(function(n){function i(n){n.style.display="none";n.setAttribute("aria-hidden","true")}function r(n){n.style.display="inline-block";n.setAttribute("aria-hidden","false")}var u,t;n&&n.sglid&&sj_be&&sj_cook&&sj_evt&&_d&&typeof _d.querySelectorAll!="undefined"&&(u=function(n){var i=n.getAttribute("data-a"),t=n.getAttribute("data-p");i==="false"&&t!=null&&sj_be(n,"click",function(){sj_cook.set("SRCHUSR","POEX",t,!0,"/")})},sj_evt.bind("identityHeaderShown",function(){var n=!1;sj_be(_ge("id_l"),"click",function(){var i,t;if(!n){for(i=_d.querySelectorAll(".b_imi"),t=0;t<i.length;t++)u(i[t]);n=!0}})},!0));sj_evt&&n&&(t=function(t){var h;if(t==null||t.idp!=="orgid"||(h=n.wlProfile(),h==null||h.name==null||t.name!=null)){var e=_ge("id_n"),u=_ge("id_p"),o=_ge("id_s"),s=_ge("id_a"),f=t?t.displayName:wln,c=t?t.img:null,l=t?t.idp:null,a=t?t.cid:null;e&&o&&s&&(a||f)?(u&&c&&(u.title=f,u.src=c,r(u)),f.length>10&&(f=f.substring(0,10).replace(/\s+$/,"")+"…"),e.textContent=f,e.innerText=f,r(e),i(o),i(s),l==="WL"&&u&&(u.style.className+=" sw_spd")):e&&o&&s&&(i(e),u&&i(u),r(o),r(s))}},sj_evt.bind("wl:auth",function(){t(n.wlProfile())},1),sj_evt.bind("aad:signedout",function(){t({displayName:null,img:null,idp:"orgid"})},1),sj_evt.bind("aad:signedin",function(i){var r,u,f,e;i&&i.length>=2&&(r=i[1],r&&r.displayName&&r.uniqueName&&(u="/orgid/thumbnailPhoto?user={0}",n.orgIdPhotoUrl&&(u=n.orgIdPhotoUrl),f=u.replace("{0}",encodeURIComponent(r.uniqueName)),e={displayName:r.displayName,img:f,idp:"orgid"},t(e)))},1))})(Identity||(Identity={}))
|
1
test/static_tests/html/bing3_files/41feb33b.js
Normal file
@ -0,0 +1 @@
|
|||||||
|
function IRH(){function tt(n){r=sj_ce("img");r.src="/fd/s/mmload.gif";r.className="irhld";c=r.style;i&&(c.left=(i.w-30)/2+"px",c.top=(i.h-30)/2+"px");n.appendChild(r);n.appendChild(sj_ce("img"))}function it(t){var i=(new Date).getTime()+ht;b(t,function(r){var f=n.getHoverEl(),u;f==t&&r&&r.w>0&&r.h>0&&(u=i-(new Date).getTime(),u>0?(w(),s=sb_st(function(){n.dispHov(t,r,!1)},u)):n.dispHov(t,r,!1))})}function rt(n){var t,i;if(n&&n.w&&n.h&&(t=n.w,i=n.h,!isNaN(t)&&!isNaN(i))){var u=t,f=i,r=p;return t>i&&t>r?(f=Math.round(r*i/t),u=r):i>r&&(u=Math.round(r*t/i),f=r),{w:u,h:f}}return null}function ut(t,u,f){function e(t){var i=n.getContContent(),u=i.lastChild,f=sj_ce("img");f.src=h(t);u&&u!=r?i.replaceChild(f,u):i.appendChild(f)}function s(t){function e(t,r,u){i&&t&&(o&&o.stop(),l=i,a=t,o=new sj_anim(function(t,i){var f=l.w,e=l.h,o=a.w,s=a.h,h={w:(o-f)*i/100+f,h:(s-e)*i/100+e};k(h);n.setContPos(u);sj_so(r,i)}),o.init(null,0,100,10,function(){o=null}))}for(var f=n.getContContent(),u=f.childNodes,r;u.length>2;)f.removeChild(u[1]);u.length>1&&(r=u[1],sj_fader().init(r,100,0,10,function(){r&&r.parentNode&&r.parentNode.removeChild(r)}));b(t,function(r){if(n.getHoverEl()==t){var u=sj_ce("img");u.src=h(t);f.appendChild(u);sj_so(u,0);r.w==0&&r.h==0&&(r=i);e(r,u,t)}})}f?s(t):(e(t),k(u))}function ft(){w()}function w(){s!=null&&(sb_ct(s),s=null)}function et(){f&&sb_ct(f);e&&sb_ct(e);f=e=null}function ot(n){t.logHover&&(t.logHover(n),f=sb_st(function(){f=null;t.logHover(n,"d2")},2e3),e=sb_st(function(){e=null;t.logHover(n,"d5")},5e3))}function h(t){var i=n.hoverAttr(t,nt),r;if(d())return[i].join("");r=i&&i.length>0&&(i.indexOf("http://")==0||i.indexOf("https://")==0||i.indexOf("/")==0)?[i]:[g,"?id=",encodeURIComponent(i),"&pid=",ct];var u=!!t.hasAttribute,f=u?t.hasAttribute(v):t[v]!=null,e=u?t.hasAttribute(y):t[y]!=null,o=n.hoverAttrNum(t,v,p),s=n.hoverAttrNum(t,y,p);return r.push("&w=",o,"&h=",s,"&p=0"),(f||e)&&r.push("&r=0"),r.join("")}function b(n,t){var i=h(n),r;u[i]==null?(r=new Image,r.onerror=function(){var n={w:0,h:0};u[i]==null?u[i]=n:n=u[i];t&&t(n)},r.onload=function(){var n=st({w:r.width,h:r.height});u[i]=n;t&&t(n)},r.src=i):t(u[i])}function st(n){var t=Math.min(Math.max(n.w,186),330),i=n.w>0?Math.floor(n.h*t/n.w):0;return{w:t,h:i}}function k(t){var u,o,r;if(d()&&(t=rt(t)),t){var c=n.getCont(),y=c.style,l=c.firstChild,a=l.style,v=l.childNodes,f=t.w,e=t.h,s="",h="";for(f&&f>0&&(s=f+"px"),e&&e>0&&(h=e+"px"),y.width=a.width=s,a.height=h,u=0;u<v.length;u++)o=v[u],r=o.style,o.className!="irhld"?(r.width=s,r.height=h):(r.left=(f-30)/2+"px",r.top=(e-30)/2+"px");i=t}}function d(){var r=n.getHoverEl(),t,i;return r&&(t=n.hoverAttr(r,"m"),t&&(i=eval("("+t+")"),i&&i.angf))?!0:!1}var t=this,n=null,r=null,c=null,s=null,f=null,e=null,o=null,l=null,a=null,g="http://ts1.mm.bing.net/th",u={},i=null,nt="ihk",ht=500,v="maxw",y="maxh",ct="3.1",p=300;(t.IsInitialized=!1,typeof MMRH!="undefined")&&(n=new MMRH,t.items=n.items,t.hoverAttr=n.hoverAttr,t.getCont=n.getCont,t.addIntercept=n.addIntercept,n.hoverClass+=" irhins",n.createEmptyHoverContent=tt,n.createHoverContent=ut,n.onHoverImmediate=it,n.onHoverDisplayed=ot,n.onHoverOut=et,n.onHideHoverContainer=ft,n.enableH2H=!0,t.IsInitialized=!0,t.setThumbUrl=function(n){g=n},t.attach=function(t,i){n.attach(t,i,nt)})}var IRHH={}
|
BIN
test/static_tests/html/bing3_files/47da7f6f.jpg
Normal file
After Width: | Height: | Size: 12 KiB |
1
test/static_tests/html/bing3_files/4842aea6.js
Normal file
1
test/static_tests/html/bing3_files/48b5b925.js
Normal file
1
test/static_tests/html/bing3_files/4987a5e9.js
Normal file
@ -0,0 +1 @@
|
|||||||
|
var bepns=bepns||function(n,t){function rt(){if(u=n("id_rh"),i=n("bepfo"),!i){var r=n("id_rwl");r&&(i=t("div"),i.id="bepfo",i.className=o,r.parentNode&&r.parentNode.insertBefore(i,r.nextSibling))}ft();sj_be(u,h,b,!1);sj_evt.bind(w,k,!1);sj_evt.bind(p,ht);sj_evt.bind("onP1",ut,1);sj_evt.bind("id:refreshed",et,1)}function ut(){var n=0,t=setInterval(function(){u&&u.offsetWidth>0&&u.offsetHeight>0?(clearInterval(t),sj_evt.fire("bepready",d)):n==80&&clearInterval(t);n++},400)}function ft(){st(u,it)}function et(){ot(_ge("idd_rwds"),_ge("idd_rwdstrial"))}function ot(n,t){n&&t&&(t.href=n.href,n.h?t.h=n.h:n.getAttribute&&n.getAttribute("h")&&t.setAttribute("h",n.getAttribute("h")))}function st(n,t){n&&(n.href=t)}function ht(n){n[1]!==y&&e()}function s(n,t){if(n&&n.className){var i=" "+n.className+" ";return i.indexOf(" "+t+" ")!==-1}return!1}function a(n,t){n&&!s(n,t)&&(n.className+=" "+t)}function v(n,t){if(s(n,t)){var i=new RegExp("(\\s|^)"+t+"(\\s|$)","g");n.className=n.className.replace(i," ")}}function b(n){i&&(s(i,o)?nt(n):e(n))}function k(n){i&&(!i||s(i,o)?nt(n):e(n),sj_evt.unbind(w,k))}function ct(){u&&sj_ue(u,h,b,!1)}function d(n){typeof _H!="undefined"&&(n&&n>0?lt():g())}function lt(){a(u,"rigleamon")}function g(){v(u,"rigleamon")}function nt(n){if(sj_evt.fire("focusChange","bep"),i){i.firstChild||(r=t("iframe"),r.id="bepfm",r.frameBorder="no",r.scrolling="no",r.height=0,sj_be(r,tt,yt,!1),i.appendChild(r),f=t("div"),f.id="bepfl",f.innerText=f.textContent="Loading...",i.appendChild(f),vt(f));var w=_w.location.search.substr(1),g=/(^|&)rewardstesthooks=1(&|$)/i.exec(w),b=/(?:^|&)rewardsbag=([^&]*)(?:&|$)/i.exec(w),s=new Date,k=s.getDate(),d=s.getMonth()+1,nt=(d<10?"0":"")+d+"/"+(k<10?"0":"")+k+"/"+s.getFullYear();r.src="/rewardsapp/bepflyoutpage?style=modular&date="+nt+(g&&b?"&atlahostname=localhost&bag="+b[1]:"");v(i,o);u.setAttribute("aria-expanded","true")}a(u,"openfo");sj_sp(n);sj_evt.fire(p,y);sj_be(_d,h,e,!0);sj_be(_d,c,l,!0)}function e(n){s(i,o)||a(i,o);v(u,"openfo");typeof _H!="undefined"&&g();u.setAttribute("aria-expanded","false");sj_ue(_d,h,e,!0);sj_ue(_d,c,l,!0);r&&r.contentWindow&&sj_ue(r.contentWindow.document,c,l,!0);n&&sj_sp(n)}function at(n){n&&(n.style.display="none")}function vt(n){n&&(n.style.display="block")}function yt(){at(f);r.height=Math.min(r.contentWindow.document.body.scrollHeight,569);r&&r.contentWindow&&sj_be(r.contentWindow.document,c,l,!0)}var y="bepfo",p="onPopTR",w="openbep",u,i,f,r,h="click",c="keyup",tt="load",o="b_hide",it="javascript:void(0)",l=function(n){var f=n.which||n.keyCode,i=sj_et(n),t;if(f==27){e(n);u.focus();return}if(f==9&&i&&r){if(t=i.nodeName,t=="BODY"||t=="HTML"||t=="#document")return;r.contentWindow.document.body.contains(i)||e(n)}};return rt(),{sg:d,ubc:ct}}(_ge,sj_ce)
|
BIN
test/static_tests/html/bing3_files/49898d58.jpg
Normal file
After Width: | Height: | Size: 12 KiB |
1
test/static_tests/html/bing3_files/4b57bcc0.css
Normal file
BIN
test/static_tests/html/bing3_files/513f6c6d.jpg
Normal file
After Width: | Height: | Size: 17 KiB |
1
test/static_tests/html/bing3_files/51954e7f.css
Normal file
1
test/static_tests/html/bing3_files/52077b8b.css
Normal file
BIN
test/static_tests/html/bing3_files/5399e534.jpg
Normal file
After Width: | Height: | Size: 14 KiB |
BIN
test/static_tests/html/bing3_files/5506e9ae.jpg
Normal file
After Width: | Height: | Size: 12 KiB |
1
test/static_tests/html/bing3_files/5944815d.css
Normal file
1
test/static_tests/html/bing3_files/5a0645fd.css
Normal file
1
test/static_tests/html/bing3_files/5a49c198.css
Normal file
@ -0,0 +1 @@
|
|||||||
|
.b_slimFoot.b_footer{padding:0}.b_slimFoot.b_footer ul{line-height:30px}.b_slimFoot.b_footer li{display:inline-block;padding:0 15px}.b_slimFoot.b_footer a{text-decoration:none}.b_slimFoot.b_footer,.b_slimFoot.b_footer a:hover{color:#666}.b_slimFoot.b_footer .b_trademark{float:right;padding-right:20px}.b_slimFoot #b_footerItems{line-height:30px;height:auto;padding:0 20px 0 15px}.b_slimFoot #b_footerItems span,.b_slimFoot #b_footerItems a{margin:0}
|
1
test/static_tests/html/bing3_files/5b7ca86e.css
Normal file
1
test/static_tests/html/bing3_files/5d7b152f.js
Normal file
@ -0,0 +1 @@
|
|||||||
|
(function(){var s=_ge("b_results"),n=Lib.CssClass.getElementByClassName(s,"exp_trgr"),t,f,u,i,r;if(n!==null&&n.length>0)for(t=0;t<n.length;t++)if(f=n[t].offsetHeight,u=Lib.CssClass.getElementByClassName(n[t],"ibsvc"),u!==null&&u.length>0&&(i=u[0].getElementsByTagName("a"),i.length>0))for(r=0;r<i.length;r++){var h=i[r].offsetHeight,e=Math.floor((f-h)/2),o=i[r];o.style.paddingTop=e+"px";o.style.paddingBottom=e+"px"}sj_evt.bind("MapPinHov",function(n){var t=_ge("exp_trgr_"+n[1]);t&&Lib.CssClass.toggle(t,"sa_hl")})})()
|
1
test/static_tests/html/bing3_files/6057ffef.css
Normal file
1
test/static_tests/html/bing3_files/61af5a59.js
Normal file
@ -0,0 +1 @@
|
|||||||
|
(function(){var f=_ge("b_results"),n,t,i,r,u;if(typeof Lib!="undefined"&&typeof Lib.CssClass!="undefined"&&(n=Lib.CssClass.getElementByClassName(f,"exp_trgr"),n!==null&&n.length>0))for(t=0;t<n.length;t++)if(i=n[t].getElementsByTagName("a"),i.length>0)for(r=0;r<i.length;r++)(u=i[r],u.parentElement&&u.parentElement.className.indexOf("bm_dir_overlay")>=0)||sj_be(u,"click",function(n){sj_sp(n)})})()
|
1
test/static_tests/html/bing3_files/62533aa1.svg
Normal file
@ -0,0 +1 @@
|
|||||||
|
<svg focusable="false" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" enable-background="new 0 0 16 16"><g fill="#00809D"><path d="M2.25 0h-1.25c-.263 0-.521.107-.707.293-.186.186-.293.444-.293.707v1.25c0 .552.448 1 1 1s1-.448 1-1v-.25h.25c.552 0 1-.448 1-1s-.448-1-1-1zM1 8.75c.552 0 1-.448 1-1v-1.5c0-.552-.448-1-1-1s-1 .448-1 1v1.5c0 .552.448 1 1 1zM2.25 12h-.25v-.25c0-.552-.448-1-1-1s-1 .448-1 1v1.25c0 .263.107.521.293.707s.444.293.707.293h1.25c.552 0 1-.448 1-1s-.448-1-1-1zM11.75 2h.25v.25c0 .552.448 1 1 1s1-.448 1-1v-1.25c0-.263-.107-.521-.293-.707-.186-.186-.444-.293-.707-.293h-1.25c-.552 0-1 .448-1 1s.448 1 1 1zM6.25 2h1.5c.552 0 1-.448 1-1s-.448-1-1-1h-1.5c-.552 0-1 .448-1 1s.448 1 1 1zM14.5 7h-.5v-.75c0-.552-.448-1-1-1s-1 .448-1 1v.75h-3.5c-.828 0-1.5.671-1.5 1.5v3.5h-.75c-.552 0-1 .448-1 1s.448 1 1 1h.75v.5c0 .828.672 1.5 1.5 1.5h6c.828 0 1.5-.672 1.5-1.5v-6c0-.829-.672-1.5-1.5-1.5z"/></g><path fill="none" d="M0 0h16v16h-16z"/></svg>
|
After Width: | Height: | Size: 964 B |
1
test/static_tests/html/bing3_files/6323ce42.js
Normal file
@ -0,0 +1 @@
|
|||||||
|
var SerpKeyboardNavigation;(function(){function c(){h=_d.activeElement;n=null;u=null;e=!1;t=-1;nt();u=_w.NavSelector&&NavSelector(!1)}function p(){v();n=null}function w(i){var o,e;i&&(i.keyCode==r.Tab&&s&&(f("TOP"),s=!1),o=_d.activeElement,u&&o&&o.className!=="b_searchbox"&&(i.keyCode==r.Enter?(n=null,f(t==-1?"EN":"EE",t)):b(i)&&(e=k(i.keyCode),e!==-1&&e!==t&&(tt(e),sj_pd(i)))))}function f(n,t){sj_log("CI.SerpKeyboardNav",n,t?t.toString():"")}function b(t){return n||h==_d.activeElement?t.altKey||t.ctrlKey?!1:!0:!1}function k(n){if(n===r.Tab)return d();if(n===r.Down||n===r.Up){var t=document.activeElement;return t&&(t.tagName.toLowerCase()==="select"||t.tagName.toLowerCase()==="input")?-1:g(n===r.Down)}return-1}function d(){var i=-1;return n?(v(),e=!0,t=-1,f("TO")):(i=0,f("TI")),i}function g(i){var r=-1,s,h,o;return n&&(e?(e=!1,s=u.indexOf(_d.activeElement),s!==-1?r=l(i,s):(h=_w.NavSelector&&NavSelector(!0),o=h.indexOf(_d.activeElement),o!==-1&&(r=a(i?o:o-1)))):r=l(i,t),f(i?"AD":"AU",r)),r}function l(n,t){return a(n?t+1:t-1)}function a(n){return Math.max(Math.min(n,u.length-1),0)}function nt(){i=sj_ce("div","kn_p");o=sj_ce("span",y);o.innerHTML="►";i.appendChild(o);o.title="Use the up and down arrow keys to focus results"}function tt(r){t=r;n=u[t];n&&n.parentNode&&(n.parentNode.insertBefore(i,n.parentNode.firstChild),it(i),n.setAttribute("aria-live","true"),n.focus())}function v(){i&&i.parentNode&&i.parentNode.removeChild(i)}function it(n){var t=n.getBoundingClientRect();t.bottom>window.innerHeight&&n.scrollIntoView()}var n,u,t=-1,e=!1,y="kn_a",i,o,s=!0,h,r;(function(n){n[n.Up=38]="Up";n[n.Down=40]="Down";n[n.Tab=9]="Tab";n[n.Enter=13]="Enter"})(r||(r={}));sj_be(_d,"keydown",w);sj_be(_d.body,"mousedown",p,!0);sj_evt.bind("ajax.load",c,1,1);c()})(SerpKeyboardNavigation||(SerpKeyboardNavigation={}))
|
8
test/static_tests/html/bing3_files/64c27dd3.svg
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
<svg focusable="false" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
||||||
|
viewBox="0 0 16 16" enable-background="new 0 0 16 16" xml:space="preserve">
|
||||||
|
<path fill="#919191" d="M15.707,0.293c-0.391-0.391-1.024-0.391-1.415,0L7.994,6.591L1.696,0.293C1.298-0.091,0.665-0.08,0.281,0.318
|
||||||
|
c-0.375,0.388-0.375,1.003,0,1.391l6.298,6.298l-6.298,6.298c-0.384,0.398-0.373,1.031,0.025,1.415c0.388,0.375,1.003,0.375,1.391,0
|
||||||
|
l6.298-6.298l6.298,6.298c0.398,0.384,1.031,0.373,1.415-0.025c0.375-0.388,0.375-1.003,0-1.39L9.409,8.006l6.298-6.298
|
||||||
|
C16.098,1.317,16.098,0.684,15.707,0.293z"/>
|
||||||
|
<path fill="none" d="M0,0h16v16H0V0z"/>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 671 B |
1
test/static_tests/html/bing3_files/6798a322.js
Normal file
@ -0,0 +1 @@
|
|||||||
|
var Orientation;(function(n){function f(n){var f=_w.innerWidth,e;i&&(e=window.matchMedia("(orientation: portrait)"),e.addListener(function(t){_w.innerWidth!=f&&(f=_w.innerWidth,n(!t.matches))}));t&&sj_be(_w,u,function(){_w.innerWidth!=f&&(f=_w.innerWidth,n(_w.innerWidth>_w.innerHeight))});i||t||r||sb_si(function(){_w.innerWidth!=f&&(f=_w.innerWidth,n(_w.innerWidth>_w.innerHeight))},1e3)}var i="matchMedia"in _w,t="onorientationchange"in _w,r="onresize"in _w,u=t?"orientationchange":"resize";n.onOrientation=f})(Orientation||(Orientation={}))
|
1
test/static_tests/html/bing3_files/71b450b0.js
Normal file
@ -0,0 +1 @@
|
|||||||
|
function RewardsReportActivity(n){window.sj_rra&&sj_rra(n)}(function(){RewardsReportActivity(document.URL)})()
|
1
test/static_tests/html/bing3_files/7232c1ce.js
Normal file
@ -0,0 +1 @@
|
|||||||
|
var MultiEntityFeedback;(function(n){function t(t,i,e,o,s){var h,c,l;Log.Log("MEFInit","ReportProblem","Init",!1);h=_ge(i);h&&(c=f(h,t),c!=null&&(l="localFeedbackContainer",c.className+=" "+l,h.setAttribute("data-fbhlsel","."+l)));e?(Log.Log("MEFClickEventsTrue","ReportProblem","Init",!1),n.rapUrl=o,sj_be(_ge("multiEntityFeedbackThumbsUp"),"click",r),sj_be(_ge("multiEntityFeedbackThumbsDown"),"click",function(){u(s)})):Log.Log("MEFClickEventsFalse","ReportProblem","Init",!1);Log.Log("MEFComplete","ReportProblem","Init",!1)}function i(){var n=_ge("beforeMultiEntityFeedback"),t=_ge("afterMultiEntityFeedback");n.classList.add("hideEntry");t.classList.remove("hideEntry")}function r(){var t,r,n,u;Log.Log("MEFSubmitInit","ReportProblem","Init",!1);i();t={};t.text="User selected Thumbs Up on Multi-entity Local answer";t.type="2";r=FeedbackCommonUtils.getLocalGenericFeedbackSubmitModule();r!=undefined&&r.sendData(t,"LocalMultiEntityFeedback");n=FeedbackCommonUtils.getReportProblemClientInstModule();n!=undefined&&(u=window.parent,u.Log.Log(n.Feature.MultiFeedbackThumbsUp,n.ReportProblem,n.UserActions,!0));Log.Log("MEFSubmitComplete","ReportProblem","Init",!1)}function u(t){var i,r;Log.Log("MEFShowInit","ReportProblem","Init",!1);n.rapUrl!=null&&n.rapUrl!=""&&(r=window.parent,r.MultiFeedbackBootstrap.InitializeMultiEntityFeedback("multiEntityFeedbackNew",n.rapUrl,t));i=FeedbackCommonUtils.getReportProblemClientInstModule();i!=undefined&&(r=window.parent,r.Log.Log(i.Feature.MultiFeedbackThumbsDown,i.ReportProblem,i.UserActions,!0,i.DebugId,i.instrumentationDebugId));Log.Log("MEFShowComplete","ReportProblem","Init",!1)}function f(n,t){while(n=n.parentElement)if(n.className.indexOf(t)>-1)return n;return null}n.init=t})(MultiEntityFeedback||(MultiEntityFeedback={}))
|
1
test/static_tests/html/bing3_files/7532ed8f.js
Normal file
1
test/static_tests/html/bing3_files/76c74bea.css
Normal file
@ -0,0 +1 @@
|
|||||||
|
.MicrosoftMap .Infobox{position:relative;border:1px solid #888;border-radius:8px;left:0;top:0;pointer-events:auto;background-color:#fff}.MicrosoftMap .infobox-body{pointer-events:auto}.MicrosoftMap .infobox-close{color:#777;height:14px;outline:medium none;position:absolute;right:5px;text-align:center;text-decoration:none;top:5px;width:14px;pointer-events:auto}.MicrosoftMap .Infobox .infobox-body{padding-bottom:4px}.MicrosoftMap .Infobox .infobox-title{font-family:Verdana;font-size:10pt;line-height:1.1;margin-right:20px;font-weight:bold;padding:10px;color:#333}.MicrosoftMap .Infobox.no-close .infobox-title{margin-right:auto}.MicrosoftMap .Infobox.no-title .infobox-title{display:none}.MicrosoftMap .Infobox .infobox-title a{text-decoration:none}.MicrosoftMap .Infobox .infobox-title a:hover{text-decoration:underline}.MicrosoftMap .Infobox .infobox-info{font-family:verdana;font-size:10pt;color:#888;padding:10px;overflow:auto}.MicrosoftMap .Infobox.no-title .infobox-info{margin-right:15px}.MicrosoftMap .Infobox.no-close.no-title .infobox-info{margin-right:auto}.MicrosoftMap .Infobox .infobox-actions{border-top:1px solid #888;margin:0 0 -4px;padding:4px 0;font-size:.9em;clear:both;padding:4px 8px 8px;color:#676767;height:15px;overflow:auto}.MicrosoftMap .Infobox .infobox-actions-list{line-height:1.3;margin:0;overflow:hidden;width:100%;list-style:none outside none;margin:0 0 -8px;padding:0}.MicrosoftMap .Infobox .infobox-actions-list li{float:left;margin:0 0 4px -4px}.MicrosoftMap .Infobox .infobox-actions-list li:last-child a{border:0 none}.MicrosoftMap .Infobox .infobox-actions-list li a{border-right:1px solid #888;display:block;padding:0 8px;text-decoration:none}.MicrosoftMap .Infobox .infobox-actions-list li a.icon{width:13px;height:18px;margin:2px 8px 2px 8px;padding:0;position:relative}.MicrosoftMap .Infobox .infobox-actions-list li a.icon img{border:none}.MicrosoftMap .infobox-actions-list li a.icon:hover .iconUnderline{border-bottom:1px solid #36b}.MicrosoftMap .Infobox .infobox-actions-list li a:hover{text-decoration:underline}.MicrosoftMap .Infobox .infobox-stalk{width:14px;height:16px;background:no-repeat;position:absolute;bottom:1px}.MicrosoftMap .InfoboxCustom{pointer-events:auto}.MicrosoftMap .Infobox .infobox-stalk{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAQCAQAAACMnYaxAAAA7ElEQVQY02OYf/Xvf0zw9/+8awwMDPmax39jSh79bePBwAWU7lv8F0Nf7WYGDQZuoGSO2VU0yfP/7SMZpBhYgJIMjMvOokrOvsKgzcDLwAiSZCjM+4Qk9e5/eDODAgMbAwTkiR/6hZDc80PSmkGYgYkBBmZth0n9+9+yG+gYLqihYIPjXkMln/z3K2SQhTgGCvIFdn6HSG75JGzCIIRkKAhM3wwxtH4TgzoDJ5KhIFAQCzL4wX/vHAYZFEMhBu/58f//pvf8xgyCaIaCwIzN//5Xr2VQwzAUYvCJ/0FRsGBDA6W85bf4hODBBgQA+GzIcvxs8/oAAAAASUVORK5CYII=)}
|
1
test/static_tests/html/bing3_files/78da7cf6.js
Normal file
@ -0,0 +1 @@
|
|||||||
|
var FeedbackCommonUtils;(function(n){function t(n,t,i){var r=_ge(n);i?r.classList.add(t):r.classList.remove(t)}function i(n,t){var i=_ge(n);i&&(t?i.classList.remove("hideEntry"):i.classList.add("hideEntry"))}function r(n){var t=_ge(n);t.style.display="inline-block"}function u(n){var t=_ge(n);t.style.display="none"}function f(n,t){var i=_ge(n);i.setAttribute("placeholder",t)}function e(n){var t=_ge(n);t.removeAttribute("placeholder")}function o(n){return n.indexOf("://")<0?"http://"+n:n}function s(n){var i="",t=_ge(n);return t!=null&&t.value!=undefined&&t.value!=""&&(i=t.value),i}function h(){if(typeof FeedbackClientInstUtils!="undefined")return FeedbackClientInstUtils;var n=window.parent;if(n.ReportProblemClientInst)return n.ReportProblemClientInst}function c(){var n=window.parent;return n.LocalGenericFeedbackSubmit}n.setStyle=t;n.changeDisplay=i;n.showElement=r;n.hideElement=u;n.onBlurFeedbackComments=f;n.onFocusFeedbackComments=e;n.normalizeWebsite=o;n.getUserComments=s;n.getReportProblemClientInstModule=h;n.getLocalGenericFeedbackSubmitModule=c})(FeedbackCommonUtils||(FeedbackCommonUtils={}))
|
1
test/static_tests/html/bing3_files/7b6f93ad.js
Normal file
1
test/static_tests/html/bing3_files/7f1e2bd8.css
Normal file
@ -0,0 +1 @@
|
|||||||
|
.printContent .localEntitiesPrintText,.printContent .localListingListPrintText{position:relative;padding:0 0 10px 0;height:auto;min-height:120px;-moz-box-sizing:border-box;box-sizing:border-box;color:#000}.printContent .localListingListPrintText{width:100%}.printContent .localSearchPrintText .textColumn{max-width:510px}.printContent .entitiesCol1{width:48%;float:left}.printContent .entitiesCol2{width:48%;float:right}.printContent .hideText.printEntityAddress,.printContent .hideText.printEntityPhone,.printContent .hideText.printEntityWebsite{display:none}.printContent .printEntityTitle,.printContent .printEntityAddress,.printContent .printEntityPhone,.printContent .printEntityWebsite{margin-bottom:2px;display:flex;width:100%}.printContent .localEntityPrintTitle{display:inline;margin-left:2%;font:500 18px 'Segoe UI Semibold','Segoe UI',Helvetica,Arial;color:#000;vertical-align:top}.printContent .printEntityWebsite .localSearchPrintHeader{text-wrap:normal;-ms-word-break:break-all;word-break:break-all}.printContent .localPrintLabel,.printContent .localSearchPrintHeader{display:inline-block;font:300 16px 'Segoe UI',Helvetica,Arial}.printContent .titleHead{display:flex}.printContent .listingWebsite{word-break:break-all}.printContent .localSearchPrintTitle{display:flex;font:500 18px 'Segoe UI Semibold','Segoe UI',Helvetica,Arial;color:#000}.printContent .noteColumn{width:390px}.printContent .localPrintNotes{position:relative;float:right;padding-left:5px}.printContent .searchNotes{width:350px;height:130px;resize:none;font:200 16px 'Segoe UI Regular','Segoe UI',Helvetica,Arial;overflow:hidden}.printContent .localListingListPrintText{color:#000;margin-top:2%}.printContent .supplementalData{margin-left:8%}.printContent .entityIcon{position:relative;padding-top:0;width:25px;height:25px;display:inline-block}.printContent .entityIndex{position:absolute;font:500 13px 'Segoe UI Semibold','Segoe UI',Helvetica,Arial;color:#000;text-align:center;padding-top:12%;left:1px;width:88%}.printContent .printIcon{margin-top:2px}.printContent .localPrintFactsList li{line-height:12px;margin-bottom:4px}.printContent .localPrintLabel,.printContent .localPrintFactLabel{margin-right:10px;font:500 16px 'Segoe UI Semibold','Segoe UI',Helvetica,Arial}.printContent .printFact{display:inline-block}.printContent .richPrintIcons{margin-right:8px;vertical-align:bottom;padding-bottom:2px;height:16px;width:16px}.printContent .trailFact{margin:0 7px 0 0}.printContent .localPrintFactLabel{display:inherit}.printContent .printFact .localPrintFactLabel,.printContent .localPrintFactLabel.trailDifficulty{display:inline-block}.printContent .localPrintFactLabel.trailDifficulty{line-height:30px}.printContent .printFact .separator{margin:0 1px}.printContent .wikipediaText{width:160%}.printContent .wikipediaLabelText{font:500 16px 'Segoe UI Semibold','Segoe UI',Helvetica,Arial}.printContent .wikiTextBlock{resize:none;font:300 16px 'Segoe UI',Helvetica,Arial}.printContent .printHours{display:inline-block;font:300 16px 'Segoe UI',Helvetica,Arial}.printContent .dayOfTheWeek{padding:0 10px 5px 0}.printContent .hoursOfTheDay{padding:0 0 5px 0}.printContent .detailsAttribution{font:300 16px 'Segoe UI',Helvetica,Arial;color:#000}.printContent .localSearchPrintPanel .printedNotes{width:350px}.printContent .localSearchMapPrint{clear:both}@media print{.printContent .localSearchMapPrint,.printContent .printEntity{break-after:auto;break-before:auto;break-inside:avoid;page-break-before:auto;page-break-after:auto;page-break-inside:avoid}.printContent .localSearchPrintPanel{width:900px}}
|
1
test/static_tests/html/bing3_files/7f3c71db.js
Normal file
@ -0,0 +1 @@
|
|||||||
|
var SBIImgsHelper;(function(){function r(){sj_be(_d,n,u)}function u(n){var r=n.target||n.srcElement,u;r&&r.tagName==="IMG"&&r.classList.contains(t)&&r.src&&(u=r.getAttribute(i),u&&sj_evt&&sj_evt.fire&&sj_evt.fire("sbi_searchimgurl",SbiUtil.gimg(r),u,null,SbiUtil.gaps(r)))}var n="click",t="sbiable",i="data-sbiid";r()})(SBIImgsHelper||(SBIImgsHelper={}))
|
6
test/static_tests/html/bing3_files/7f7111bf.svg
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
<svg focusable="false" width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||||
|
<rect fill-opacity="0.2" fill="#000" x="0" y="0" width="24" height="24" rx="2"></rect>
|
||||||
|
<g transform="translate(4, 4)">
|
||||||
|
<path d="M13.2916881,1.29304814 L7.99395739,6.59077883 L2.69622669,1.29304814 C2.30349711,0.913737214 1.67923378,0.919161894 1.29315522,1.30524045 C0.907076669,1.691319 0.90165199,2.31558234 1.28096291,2.70831192 L6.57869361,8.00604261 L1.28096291,13.3037733 C0.90165199,13.6965029 0.907076669,14.3207662 1.29315522,14.7068448 C1.67923378,15.0929233 2.30349711,15.098348 2.69622669,14.7190371 L7.99395739,9.42130639 L13.2916881,14.7190371 C13.6844177,15.098348 14.308681,15.0929233 14.6947596,14.7068448 C15.0808381,14.3207662 15.0862628,13.6965029 14.7069519,13.3037733 L9.40922117,8.00604261 L14.7069519,2.70831192 C15.0976827,2.31746305 15.0976827,1.683897 14.7069519,1.29304814 C14.316103,0.902317288 13.6825369,0.902317288 13.2916881,1.29304814 Z" fill="#FFF" fill-rule="nonzero"></path>
|
||||||
|
</g>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 1.1 KiB |
1
test/static_tests/html/bing3_files/816a14d2.js
Normal file
@ -0,0 +1 @@
|
|||||||
|
var RapFeedback;(function(n){"use strict";var t=function(){function n(){this.callbacks=[];this.debugValues={}}return n.prototype.setContextValue=function(n,t){typeof n!="string"||n.length<1||(this.debugValues[n]=t)},n.prototype.setContextValues=function(n){if(n)for(var t in n)n.hasOwnProperty(t)&&this.setContextValue(t,n[t])},n.prototype.registerCollectionCallback=function(n){n&&this.callbacks.push(n)},n.prototype.collect=function(n){for(var u=this.getStaticValues(),f,i,r,t=0;t<this.callbacks.length;t++){f=this.callbacks[t];i=f(n);for(r in i)i.hasOwnProperty(r)&&(u[r]=i[r])}return u},n.prototype.clear=function(){for(var n in this.debugValues)delete this.debugValues[n];this.callbacks=[]},n.prototype.getStaticValues=function(){var t={};for(var n in this.debugValues)this.debugValues.hasOwnProperty(n)&&(t[n]=this.debugValues[n]);return t},n}();n.debugCollector=new t})(RapFeedback||(RapFeedback={}))
|
1
test/static_tests/html/bing3_files/868a2b2d.js
Normal file
@ -0,0 +1 @@
|
|||||||
|
(function(n){function w(){if(t=Bing.MapControl[i],t){h=sb_st(function(){a("Warning","Text","timeout")},1e4);var n=_ge(i+"_s");n&&sj_be(n,"load",function(){Log.Log("Latency","DynMap",i+"_s",!1,"Time",sb_gt()-s)});t.ensureDynamic(function(){c(t)})}}function b(t){var o=t.pin.getId(),i=u[o],s=[],h,c;e&&(h=_ge("pp_dl"+o),h&&s.push({label:n.dirLabel,eventHandler:function(){r(h)}}),c=_ge("pp_dpl"+o),c&&s.push({label:n.detLabel,eventHandler:function(){r(c)}}));t.handled=!0;t.infoboxOptions=e?{title:i.n,description:i.d,actions:s}:{title:i.n};i.i>-1&&(sj_evt.fire("MapPinHov",i.i,1),f!=null&&sj_evt.fire("PinHov",f.i,0),f=i)}function k(n){var t=u[n.pin.getId()].i;t>0&&(sj_evt.fire("MapPinHov",t,0),f=null,typeof LocalDominantEntity!="undefined"&&LocalDominantEntity&&LocalDominantEntity.SelectedState&&LocalDominantEntity.Index!==t&&sj_evt.fire("PinHov",LocalDominantEntity.Index,!0))}function d(n){var t=_d.getElementsByClassName("MiniInfobox2");t&&t.length!==0||(t=_d.getElementsByClassName("dm_MiniInfobox3"));t&&t.length===1&&(t[0].style.display="none",clearInterval(n))}function c(r){var u,w,c,nt,rt;if(t=r,sj_evt.bind("PinHov",g,0),u=Microsoft.Maps.Events,e){w=0;v&&(w=y);var tt="",it="#sidebar",f=_ge("content");f||(it="#b_context",tt=".b_footer",f=_ge("b_content"));f&&(f.style.minWidth=f.offsetWidth+"px");r.dockRight(p,{topAlign:it,animate:!1,marginRight:w,footer:tt});c=_ge(i);c&&(c.className=c.className+" wpc_dockedMap",c.style.zIndex="0")}else r.Map.setOptions({disablePanning:o,disableZooming:o}),u.addHandler(r.Map,"click",l),u.addHandler(r,"pinclick",l);nt=n.mpQuery;nt&&r.loadObject&&r.loadObject("MicroPOIManager",function(n){n.show(nt)});r.Map.setOptions({disableKeyboardInput:!0});n.hasdom||(u.addHandler(r,"pinhover",b),u.addHandler(r,"pinhoverend",k));typeof LocalDominantEntity!="undefined"&&LocalDominantEntity&&LocalDominantEntity.SelectedState&&_d.getElementsByClassName&&(rt=sb_si(function(){d(rt)},50));_d.activeElement&&_d.activeElement.blur();sb_ct(h);a("Latency","Time",sb_gt()-s);sj_evt.fire("MapAggregation.OnDynamicReady",t)}function l(n){var t,i;return n&&(t=_ge("dynmap"),n.targetType=="pushpin"?(i=_ge("pp_dpl"+n.target.getId()),i?r(i):t&&r(t)):n.targetType=="map"&&t&&r(t),n.handled=!0),!1}function r(n){if(typeof si_ct=="function")si_ct(n);else if(n.dispatchEvent){var t=_d.createEvent("MouseEvents");t.initMouseEvent("mousedown",!0,!0,_w,0,0,0,0,0,!1,!1,!1,!1,0,null);n.dispatchEvent(t)}else n.fireEvent&&n.fireEvent("onmousedown");_w.location=n.href}function g(n){for(var i=0;i<u.length;i++)if(u[i].i==n[1]&&t.pushpins&&t.pushpins[i]){t.pushpins[i].setHover(n[2]);break}}function a(n,t,r){Log.Log(n,"DynMap",i,!1,t,r)}var e=n.docked,v=n.socialPane,u=n.pins,o=n.disablePanAndZoom===undefined?!0:n.disablePanAndZoom,t,i,y=50,p=-690,s=sb_gt(),h,f;i=pushPinData.mapControlId;pushPinData.ensureDynamic===undefined||pushPinData.ensureDynamic?sj_evt.bind("mapCtrlOnLoad",w,1):sj_evt.bind("dynMapLoaded",function(){if(typeof Bing!="undefined"&&typeof Bing.MapControl!="undefined"){var n=Bing.MapControl[i];n&&c(n)}},1)})(pushPinData)
|
1
test/static_tests/html/bing3_files/87c825a2.js
Normal file
1
test/static_tests/html/bing3_files/89ec5885.js
Normal file
1
test/static_tests/html/bing3_files/8d8ec60b.js
Normal file
1
test/static_tests/html/bing3_files/8ede1f05.js
Normal file
@ -0,0 +1 @@
|
|||||||
|
var MultiFeedbackBootstrap;(function(n){function e(n,t,u,e){var k,o,v,d,l;e===void 0&&(e="1002");ReportProblemClientInst.instrumentationDebugId=ReportProblemClientInst.getDebugId();LocalGenericFeedbackSubmit.isSubmitDone=!1;FeedbackBootstrapUtils.linkId=n;FeedbackBootstrapUtils.setHighlightedDiv();var g=_ge("multiEntityFeedbackThumbsDown"),it=g.getBoundingClientRect(),nt=sb_de.clientWidth+_d.documentElement.scrollLeft,tt=sb_de.clientHeight,a=sj_ce("div","multiFeedbackContent","r_mfContentDiv");a.style.top=((tt-350)/2).toString()+"px";a.style.left="760px";a.style.zIndex=(parseInt(e)+2).toString();var y=sj_ce("div","multiFeedbackTitlebar","r_mfTitlebarDiv"),p=sj_ce("a","multiFeedbackClose","r_mfCloseDiv");p.style.zIndex=(parseInt(e)+2).toString();y.appendChild(p);var b=sj_ce("h2","multiFeedbackTitle","r_mfTitleDiv");b.innerHTML=u;y.appendChild(b);a.appendChild(y);var w=sj_ce("iframe","multiFeedbackIframe","r_mfIframeDiv");for(w.name="MultiFeedback",w.src=t+"&format=inline",a.appendChild(w),sj_b.appendChild(a),_w.addEventListener("beforeunload",f),FeedbackBootstrapUtils.highlightedDiv!=null&&(FeedbackBootstrapUtils.highlightedDiv.classList.add("redBorder"),FeedbackBootstrapUtils.highlightedDiv.style.zIndex=(parseInt(e)+1).toString(),FeedbackBootstrapUtils.highlightedDiv.style.position="relative",k="multiFeedbackContentOverlay",o=sj_ce("div",k,"r_mffbol"),o.style.height=_d.documentElement.scrollHeight+"px",o.style.width=nt+"px",o.style.zIndex=e,o.style.top="0",o.style.left="0",o.style.position="fixed",o.style.backgroundColor="#000",o.style.opacity="0.75",sj_b.appendChild(o)),v=1;v<6;v++)d="exp_trgr_"+v.toString(),l=_ge(d),l!=undefined&&l!=null&&(l=c(l,!0),sj_be(l,"click",i),sj_be(l,"mouseover",i),sj_be(l,"mouseout",i),h(l));sj_be(p,"click",function(n){s(n)});document.onkeydown=function(n){n&&n.keyCode==27&&r(n)}}function r(n){LocalGenericFeedbackSubmit.isSubmitDone||(ReportProblemClientInst.log(ReportProblemClientInst.Feature.MultiFeedback,ReportProblemClientInst.Element.Escape,ReportProblemClientInst.EventType.Clicked),ReportProblemClientInst.submitMultiEntityClientInst(),Log.Log("MultiFeedbackEscapeBeforeSubmit",ReportProblemClientInst.ReportProblem,ReportProblemClientInst.CloseActions,!0,ReportProblemClientInst.DebugId,ReportProblemClientInst.instrumentationDebugId));t(n)}function t(n){var i,t;sj_pd(n);sj_sp(n);i=_ge("multiFeedbackContent");i.parentNode.removeChild(i);t=_ge("multiFeedbackContentOverlay");t!=undefined&&t.parentNode.removeChild(t);u()}function o(){var n=_ge("multiFeedbackContent");n.style.opacity="0";setTimeout(function(){n.parentNode.removeChild(n)},3e3);u()}function s(n){LocalGenericFeedbackSubmit.isSubmitDone||(ReportProblemClientInst.log(ReportProblemClientInst.Feature.MultiFeedback,ReportProblemClientInst.Element.Close,ReportProblemClientInst.EventType.Clicked),ReportProblemClientInst.submitMultiEntityClientInst(),Log.Log("MultiFeedbackCloseBeforeSubmit",ReportProblemClientInst.ReportProblem,ReportProblemClientInst.CloseActions,!0,ReportProblemClientInst.DebugId,ReportProblemClientInst.instrumentationDebugId));t(n)}function u(){var t,i,n;LocalGenericFeedbackSubmit.isSubmitDone?(t=_ge("beforeMultiEntityFeedback"),i=_ge("afterMultiEntityFeedback"),t.classList.add("hideEntry"),i.classList.remove("hideEntry")):(n={},n.localFeedbackType="multiEntity",n.text="User selected Thumbs Down on Multi-entity Local answer",n.type="3",LocalGenericFeedbackSubmit.sendData(n,"LocalMultiEntityFeedback"));_w.removeEventListener("beforeunload",f);setTimeout(function(){location.reload()},1500)}function f(){LocalGenericFeedbackSubmit.isSubmitDone||Log.Log(ReportProblemClientInst.Feature.MultiFeedbackUnloaded,ReportProblemClientInst.ReportProblem,ReportProblemClientInst.CloseActions,!0,ReportProblemClientInst.DebugId,ReportProblemClientInst.instrumentationDebugId)}function i(n){for(var t=sj_et(n);t!=null&&!t.classList.contains("exp_trgr");)t=t.parentElement;t!=null&&t.parentElement!=null&&t.parentElement.parentElement!=null&&(t=t.parentElement.parentElement,n.type=="mouseover"||n.type=="mouseout"?t.classList.contains("redBorderSmall")?(t.classList.remove("redBorderSmall"),t.classList.contains("redBorder")||t.classList.add("hiddenborder")):(t.classList.remove("hiddenborder"),t.classList.add("redBorderSmall")):t.classList.contains("redBorder")?t.classList.remove("redBorder"):t.classList.add("redBorder"),sj_sp(n),sj_pd(n))}function h(n){while(n!=null&&!n.classList.contains("exp_trgr"))n=n.parentElement;n!=null&&n.parentElement!=null&&n.parentElement.parentElement!=null&&(n=n.parentElement.parentElement,n.classList.add("hiddenborder"))}function c(n,t){var i;if(t)i=n.cloneNode(!0),n.parentNode.replaceChild(i,n);else{for(i=n.cloneNode(!1);n.hasChildNodes();)i.appendChild(n.firstChild);n.parentNode.replaceChild(i,n)}return i}n.InitializeMultiEntityFeedback=e;n.MultiFeedbackEscapeEvent=r;n.CloseMultiFeedback=t;n.AutoFadeMultiFeedbackPopover=o})(MultiFeedbackBootstrap||(MultiFeedbackBootstrap={}))
|
After Width: | Height: | Size: 11 KiB |
1
test/static_tests/html/bing3_files/a315a519.js
Normal file
1
test/static_tests/html/bing3_files/a78009c3.js
Normal file
@ -0,0 +1 @@
|
|||||||
|
(function(n){function t(t,i){function nt(n){var t=n.target;t&&(h(t,!0),sj_evt.fire("MapPinHov",t.data.i,1))}function tt(n){var t=n.target;t&&(h(t,!1),sj_evt.fire("MapPinHov",t.data.i,0))}function it(n){for(var r=0;r<t.pins.length;r++)if(t.pins[r].i==n[1]&&i.Map.entities.get(r)){h(i.Map.entities.get(r),n[2]);break}}function rt(){function t(n){n.preventDefault();sj_evt.fire("ShowResultsMapOverlay")}var n=Microsoft.Maps.Internal._Gimme(document).select(".ref_more")[0];n&&(sj_be(n,"click",t),sj_be(n,"keydown",function(n){n.keyCode===13&&t(n)}))}var r,u,e,s,w,b,k,c,g;i.Map.entities.clear();i.pushpins={};var l=t.pins.length,a=new Array(l),v={51:{icon:"/s/local/map/51.png",height:17,width:17,anchor:new Microsoft.Maps.Point(8,8),state:Microsoft.Maps.EntityState.none,zIndex:1},152:{icon:"/s/local/map/152.png",width:24,height:24,anchor:new Microsoft.Maps.Point(12,12),state:Microsoft.Maps.EntityState.none,zIndex:1}},y=v[n.defaultIconStyle],o=y?y:v[51],p={icon:"/s/local/map/57.png",height:27,width:27,anchor:new Microsoft.Maps.Point(13,13),state:Microsoft.Maps.EntityState.highlighted,zIndex:3},h=function(t,r){r=r?!0:!1;t.setOptions({state:r?Microsoft.Maps.EntityState.highlighted:Microsoft.Maps.EntityState.none});t.infoBox.setOptions({visible:r});n.disablePushPinInfoBox||(r?t.infoBox.setMap?t.infoBox.setMap(i.Map):i.Map.entities.indexOf(t.infoBox)==-1&&i.Map.entities.push(t.infoBox):t.infoBox.setMap?t.infoBox.setMap(null):i.Map.entities.indexOf(t.infoBox)!=-1&&i.Map.entities.remove(t.infoBox));t.data.d?r?t.setOptions(p):t.setOptions({icon:"/s/local/map/48.png",width:30,height:30,anchor:{x:15,y:15}}):r?t.setOptions(p):t.setOptions(o)};for(r=0;r<l;r++)u=t.pins[r],e=new Microsoft.Maps.Location(u.lat,u.lon),a[r]=e,s=new Microsoft.Maps.Infobox(e,{title:u.n,visible:!0,maxHeight:100,showPointer:!1,showCloseButton:!1,autoAlignment:!0,zIndex:1e4}),pushPin=new Microsoft.Maps.Pushpin(e,{infobox:s}),u.d?pushPin.setOptions({icon:"/s/local/map/48.png",width:30,height:30,anchor:{x:15,y:15},zIndex:5}):(w=n.dropNumberedPushPins?null:u.i.toString(),b=n.showPushpinTitle?u.n:null,pushPin.setOptions({icon:o.icon,width:o.width,height:o.height,anchor:o.anchor,text:w,title:b})),pushPin.data=u,pushPin.infoBox=s,s.setMap&&(k='<div class="dm_MiniInfobox3">'+u.n+"<\/div>",s.setOptions({htmlContent:k})),Microsoft.Maps.Events.addHandler(pushPin,"mouseover",nt),Microsoft.Maps.Events.addHandler(pushPin,"mouseout",tt),i.Map.entities.push(pushPin);if(t.customPushpins!=null){var d=t.customPushpins.length,ut=new Array(d),f=3.5,ft=['<svg xmlns="http://www.w3.org/2000/svg" width="',f*2,'" height="',f*2,'"><circle cx="',f,'" cy="',f,'" r="',f,'" fill="',"rgba(98, 79, 205)",'"/><\/svg>'];for(r=0;r<d;r++)c=t.customPushpins[r],e=new Microsoft.Maps.Location(c.lat,c.lon),ut[r]=e,pushPin=new Microsoft.Maps.Pushpin(e),pushPin.setOptions({icon:ft.join(""),height:2*f,width:2*f,anchor:new Microsoft.Maps.Point(1.25*f,1.25*f),state:Microsoft.Maps.EntityState.none,zIndex:1}),i.Map.entities.push(pushPin)}g=Microsoft.Maps.LocationRect.fromLocations(a);typeof i.Map.getV8Map=="undefined"&&i.Map.setView({bounds:g,padding:15});sj_evt.bind("PinHov",it,0);sj_evt.fire("MapAggregation.OnPinsAdded",i.Map);rt()}sj_evt.bind("MapAggregation.OnDynamicReady",function(){t(n,Bing.MapControl.MapCtrl)},1)})(pushPinData)
|
1
test/static_tests/html/bing3_files/a7c68aca.css
Normal file
1
test/static_tests/html/bing3_files/a8ec904e.js
Normal file
1
test/static_tests/html/bing3_files/a9b12688.js
Normal file
@ -0,0 +1 @@
|
|||||||
|
var sj_rra=function(n){var i="/rewardsapp/reportActivity",u=_w.location.search.substring(1),r=window.data_iid,t,f;i+=r&&r.length>0?"?IG="+_G.IG+"&IID="+r+"&"+u:"?"+u;_w._H&&_w._H.mkt&&(i+="&src=hp");t=sj_gx();f="url="+escape(n)+"&V=web";t.open("POST",i,!0);t.setRequestHeader("Content-type","application/x-www-form-urlencoded");t.onreadystatechange=function(){t&&t.readyState==4&&t.status==200&&t.responseText&&_w.sj_appHTML&&sj_appHTML(sj_b,t.responseText)};t.send(f)}
|
1
test/static_tests/html/bing3_files/aea7e831.js
Normal file
@ -0,0 +1 @@
|
|||||||
|
(function(){var t=_ge("id_h"),n=_ge("langChange"),i=_ge("me_header"),r=_ge("langDId"),u=_ge("mapContainer");t!=null&&n!=null&&i==null&&(r===null||u===null)&&(t.insertBefore(n,t.firstChild),n.className=n.className+" langdisp")})()
|
1
test/static_tests/html/bing3_files/b3529860.js
Normal file
4
test/static_tests/html/bing3_files/b83d57c0.svg
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
<svg focusable="false" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" enable-background="new 0 0 16 16">
|
||||||
|
<path d="M0 0h16v16h-16v-16z" fill="none"/>
|
||||||
|
<path fill="#007DAA" d="M11 4h4l-5-4v3c0 .552.447 1 1 1zm-3-1v-3h-4.5c-.828 0-1.5.672-1.5 1.5v13c0 .828.672 1.5 1.5 1.5h10c.828 0 1.5-.672 1.5-1.5v-8.5h-4c-1.654 0-3-1.346-3-3zm4.707 10.707c-.181.181-.431.293-.707.293h-7c-.276 0-.526-.112-.707-.293s-.293-.431-.293-.707.112-.526.293-.707.431-.293.707-.293h7c.276 0 .526.112.707.293s.293.431.293.707-.112.526-.293.707zm0-5.414c.181.181.293.431.293.707s-.112.526-.293.707-.431.293-.707.293h-7c-.276 0-.526-.112-.707-.293s-.293-.431-.293-.707.112-.526.293-.707.431-.293.707-.293h7c.276 0 .526.112.707.293z"/>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 726 B |
1
test/static_tests/html/bing3_files/b8881a70.js
Normal file
@ -0,0 +1 @@
|
|||||||
|
var WRT=function(){function w(){var n=_ge("b_results");n&&_w.sa_CTBConfig&&(i[v]=g,i[y]=s,i[p]=s,sj_be(sj_b,"click",function(n){r(n)}),sj_evt.bind("onPopTR",function(n){r(n,!0)}),sj_be(sj_b,"mousedown",function(n){o(n)}),sj_be(sj_b,"mouseup",function(n){o(n)}),e(n.firstChild))}function e(n){n&&n.nodeType==1&&(b(n),e(n.nextSibling))}function b(n){var s,i,e;if(n){var r=tt(a,n,"span"),o=n.getElementsByTagName("cite"),f=c(n,"u");f&&t(f,"u")[0]==="e"&&(f=null);r&&o.length&&(s=o[0],n.tt=r,k(n,f)&&(i=sj_ce("a"),i.href="#",i.setAttribute("aria-label",sa_CTBConfig.TRGT),i.setAttribute("aria-haspopup","true"),i.setAttribute("aria-expanded","false"),i.setAttribute("role","button"),sj_be(i,"click",d),r.parentNode.replaceChild(i,r),i.appendChild(r),e=sj_ce("span",0,"c_tlbxTrgIcn "+u),n.ti=e,r.insertBefore(e,r.firstChild)))}}function k(n,r){var f=sj_ce("div",0,"c_tlbx"),e,h,o,s,u;for(h in n.tt.childNodes)o=n.tt.childNodes[h],s=t(o,"h"),s&&(u=sj_ce("div"),i[s](n,r,o,u),u.childNodes.length&&(e&&(e.className+=" c_tlbxIS"),f.appendChild(u),e=u));return f.childNodes.length?(n.toolbox=f,!0):!1}function d(t){var i=it(sj_et(t)),s,e,o;return i?(s=n,r(t),e=i.toolbox,e&&e!=s&&(i.ti.className=i.ti.className.replace(u,f),i.tt.className+=" sel",e.style.top=sj_go(i.ti,"Top")+9+"px",e.style.left=sj_go(i.ti,"Left")-3+"px",i.tt.parentNode.parentNode.appendChild(e),n=e,n.caption=i,ut(i)),o=t&&t.srcElement&&t.srcElement.parentNode,o&&o.setAttribute("aria-expanded","true"),nt(t)):!0}function r(t,i){var e,r,o;return n&&(e=sj_et(t),r=n.caption,(i||!sj_we(e,n,r))&&(r.ti.className=r.ti.className.replace(f,u),r.tt.className=r.tt.className.replace(/ sel/g,""),n.parentNode.removeChild(n),n=0),o=t&&t.srcElement&&t.srcElement.parentNode,o&&o.setAttribute("aria-expanded","false"),sj_we(e,r)&&sj_sp(t)),!0}function o(t){if(n){var i=sj_et(t),r=n.caption;i.tagName.toLowerCase()!="a"&&sj_we(i,r)&&sj_sp(t)}return!0}function g(n,i,r,u){var f;if(sa_CTBConfig.CU&&(f=t(i,"u"),f)){var o=sa_CTBConfig.NW=="1"?!0:undefined,e=f.split("|"),s=sa_CTBConfig.CU.replace("{0}",e[2]);u.appendChild(h(s.replace("{1}",e[3]),sa_CTBConfig.CT,t(r,"k"),o))}}function s(n,i,u,f){var a=t(u,"h"),s,c,e,o,l;a&&(a.indexOf("START")>0?(s=sa_CTBConfig.PDSU,c=sa_CTBConfig.PDS):(s=sa_CTBConfig.PDEU,c=sa_CTBConfig.PDE),e=n.getElementsByTagName("h3")[0].childNodes[0].href,o=e.indexOf("//"),o>0&&(e=e.substring(o+2)),o=e.indexOf("/"),o>0&&(e=e.substring(0,o)),s=s.replace("{0}",encodeURIComponent(e)),l=h("#",c,t(u,"k")),l.onclick=function(n){return(new Image).src=s.replace("{1}",sj_cook.get("MUID","MUID")),r(n,!0)},f.appendChild(l))}function nt(n){var n=sj_ev(n);return n&&(n.cancelBubble=!0),sj_pd(n),!1}function h(n,t,i,r){var u=sj_ce("a");return u.href=n,u.innerText=u.textContent=t,r&&(u.target="_blank"),i&&sj_be(u,"mousedown",function(){return si_T("&ID="+i)}),u}function tt(n,t,i){var r,o,u,f;if(typeof n=="string"){var t=t||_d,i=i||"*",e=t.getElementsByTagName(i);for(r=0,o=e.length;r<o;r++)if(u=e[r],f=u.className,f&&f.indexOf(n)!==-1)return u}}function it(n){while(n&&!rt(n,l))n=n.parentNode;return n}function rt(n,t){if(n&&n.className)for(var i=0;i<t.length;i++)if(n.className.indexOf(t[i])>=0)return!0;return!1}function c(n,i,r){var o=typeof r=="undefined",f;if(n)for(f=0;f<n.childNodes.length;f++){var u=n.childNodes[f],s=t(u,i),e=o&&s||!o&&s==r?u:0;if(!e&&u.childNodes&&u.childNodes.length&&(e=c(u,i,r)),e)return e}return 0}function t(n,t){return n&&n.getAttribute?n.getAttribute(t):null}function ut(n){var i,r,f,e,u;n&&!n.tlbxLog&&(r=n.getElementsByTagName("h3"),r.length&&r[0].childNodes.length&&(f=r[0].childNodes[0],i=t(f,"h"),i||(e=t(f,"onmousedown"),e&&(u=e.toString().match(/(ID=[^']+)/i),u&&u.length>1&&(i=u[1])))),i&&(i=i.substring(i.indexOf("=")+1),(new Image).src=_G.lsUrl+'&Type=Event.ClientInst&DATA=[{"T":"CI.Hover","Name":"ToolboxOpen","K":"'+i+'","HType":"h"}]'),n.tlbxLog=1)}var l=["b_algo","b_ans"],a="c_tlbxTrg",v="BASE:CACHEDPAGEDEFAULT",y="BASE:PREFERDOMAINSTART",p="BASE:PREFERDOMAINSTOP",u="sw_ddgn",f="sw_ddw",i={},n;return w(),{}}()
|
1
test/static_tests/html/bing3_files/b9ec54f4.js
Normal file
1
test/static_tests/html/bing3_files/bf3ac1fd.css
Normal file
1
test/static_tests/html/bing3_files/bf5c590b.js
Normal file
3
test/static_tests/html/bing3_files/bff38272.js
Normal file
1
test/static_tests/html/bing3_files/c6f6e566.js
Normal file
1
test/static_tests/html/bing3_files/c8a849a4.js
Normal file
@ -0,0 +1 @@
|
|||||||
|
function MMRH(){function st(n,t,i){function f(t){for(var i,f=n.getElementsByTagName(t),e=f.length,u=0;u<e;u++)i=f[u],r(i,k)!=null&&h(i,n)}function h(n,t){if(!n[d]){n[d]=!0;s.push(n);for(var i=n,u=null;!u&&i&&i!=t;)r(i,wt)!=null?u=i:i=i.parentNode;n[ft]=u;sj_be(n,"mouseover",e);sj_be(n,"mouseout",o)}}if(k=i,n!=null){t||(t=["img","span"]);for(var u=0;u<t.length;u++)f(t[u])}}function ht(){return s}function r(n,t,i){var u,f;if(n){if(u=!!n.hasAttribute,u?n.hasAttribute(t):n[t]!=null)return u?n.getAttribute(t):n[t];if(f=n[ft],f)return r(f,t)}return i}function c(n,t,i){var u=r(n,t,i),f=+u;return u==null||isNaN(f)?i:f}function f(){if(!t&&n.createEmptyHoverContent){t=sj_ce("div",n.hoverId,n.hoverClass);t.setAttribute("data-priority","2");(_w.location.href.indexOf("testhooks=1")>-1||_w.location.href.indexOf("testhooks=~1")>-1)&&t.setAttribute("data-tag","multimedia.mmRichHover");var i=sj_ce("span");n.createEmptyHoverContent(i);t.appendChild(i);sj_be(t,"mouseover",e);sj_be(t,"mouseout",o);a(!1)}return t}function ct(){return f().firstChild}function lt(n){n&&(b.push(n),sj_be(n,"mouseover",e),sj_be(n,"mouseout",o))}function at(){return u}function l(){var r,i,n;for(sj_ue(_w,"unload",l),t&&(sj_ue(t,"mouseover",e),sj_ue(t,"mouseout",o)),r=s.length,n=0;n<r;n++)i=s[n],i[d]=null,sj_ue(i,"mouseover",e),sj_ue(i,"mouseout",o);for(r=b.length,n=0;n<r;n++)i=b[n],sj_ue(i,"mouseover",e),sj_ue(i,"mouseout",o)}function e(t){var i=tt(sj_et(t)),r=c(i,et,0);if(i&&i!=u&&(u=i,v(t),r==0&&(w=!0,sj_be(_d,"mousemove",nt)),n.onHoverImmediate))n.onHoverImmediate(i)}function o(t){var i=tt(sj_mo(t));if(i!=u){if(n.onHoverOut)n.onHoverOut(t);ut&&i&&n.enableH2H?(u=i,v(t),g(i,null,!0)):(u=null,n.onHideHoverContainer&&n.onHideHoverContainer(),it(!1),a(!1),w&&(w=!1,sj_ue(_d,"mousemove",nt)))}}function g(t,i,r){if(n.createHoverContent(t,i,r),n.setCaptions&&n.setCaptions(t),it(!0),a(!0,!r),y(t),n.onHoverDisplayed)n.onHoverDisplayed(t)}function nt(n){v(n);y(u)}function tt(n){while(n!=null){if(r(n,k)!=null)return n;if(n==t)return u;if(n.getImage&&typeof(n.getImage=="function"))return n.getImage();n=n.parentNode&&n.parentNode!=n?n.parentNode:null}return null}function it(n){var t=f();n&&!h?(_d.body.appendChild(t),h=!0):!n&&h&&(t.parentNode.removeChild(t),h=!1)}function a(n,t){var i=f();i.style.visibility=n?"visible":"hidden";ut=n;n&&t&&(sj_so(i,0),sj_fader().init(i,0,100,10,function(){_G.TestEnv&&sj_evt.fire("Vi.Hover.ContainerVisible")}))}function vt(n){var h=f(),o,t,s,u,c,e,l,a;if(h){for(o=!1,i=i||sj_ce("div",null,"irhcs");i.lastChild;)i.removeChild(i.lastChild);for(t=1;t<=gt;t++)if(s=r(n,"t"+t),s&&s.length>0){o=!0;u=null;try{c=r(n,"m");c&&(u=eval("("+c+")"))}catch(v){u=null}e=sj_ce("span");l=r(n,"c"+t)||"";l+=" irhcs"+t;e.className=l;u&&u.dirovr&&(a=u.dirovr,e.setAttribute("dir",a));e.appendChild(_d.createTextNode(s));i.appendChild(e)}o&&i.parentNode!=h?h.appendChild(i):o||i.parentNode==null||i.parentNode.removeChild(i)}}function v(n){n=sj_ev(n);p=n.pageX?{x:n.pageX,y:n.pageY}:{x:n.clientX+Math.max(sb_de.scrollLeft,_d.body.scrollLeft),y:n.clientY+Math.max(sb_de.scrollTop,_d.body.scrollTop)}}function y(n){var u=c(n,et,0),i=f(),t,r;switch(u){case 1:t=pt(i,n);break;default:t=yt(i,n)}t&&(r=i.style,r.left=t.l+"px",r.top=t.t+"px")}function yt(n){var t=rt(),l=p.x,e=p.y,i=l+bt,r=e+kt,u=n.clientWidth,f=n.clientHeight,o=i+u>t.r,s=r+f>t.b,h,c;return o&&s?(i=t.r-u,r=e-f-dt):o?i=t.r-u:s&&(r=t.b-f),h=i<t.l,c=r<t.t,h&&u<_w.innerWidth?i=t.l:c&&f<_w.innerHeight&&(r=t.t),{l:i,t:r}}function pt(n,t){for(var u=rt(),e=n.offsetWidth,o=n.offsetHeight,i=t.offsetLeft,r=t.offsetTop,f=t;f=f.offsetParent;)i+=f.offsetLeft,r+=f.offsetTop;return i-=(e-t.offsetWidth)/2,r-=(o-t.offsetHeight)/2,i=Math.min(i,u.r-e-2),i=Math.max(i,u.l),r=Math.min(r,u.b-o-2),r=Math.max(r,u.t),{l:i,t:r}}function rt(){var n=_w.pageXOffset||sb_de.scrollLeft,t=_w.pageYOffset||sb_de.scrollTop,i=n+(_w.innerWidth||sb_de.clientWidth)-ot,r=t+(_w.innerHeight||sb_de.clientHeight)-ot;return{l:n,t:t,r:i,b:r}}var n=this,s=[],t=null,u=null,p={x:0,y:0},w=!1,i=null,ut=!1,h=!1,b=[],k=null,ft="hvpr",wt="ihp",d="irhatt",et="hp",bt=15,kt=25,dt=7,ot=19,gt=4;sj_be(_w,"unload",l);n.hoverClass="irhc";n.hoverId="irhcid";n.attach=st;n.items=ht;n.hoverAttr=r;n.hoverAttrNum=c;n.getCont=f;n.addIntercept=lt;n.getHoverEl=at;n.dispHov=g;n.getContContent=ct;n.setContPos=y;n.detach=l;n.setCaptions=vt}
|
1
test/static_tests/html/bing3_files/c9969752.js
Normal file
@ -0,0 +1 @@
|
|||||||
|
var HeaderPlusAlgo_Selector;(function(n){function e(n){for(var u,l,h,e=[],c=t(sj_b.querySelectorAll(f+(n?", :focus":""))),s=0;s<c.length;s++)u=c[s],u.className.indexOf("b_ans")!=-1||u.id=="b_pole"?(l=t(u.querySelectorAll(r)),l.length==0&&(h=o(u),h&&e.push(h))):i(u)||e.push(u);return e}function t(n){for(var i=[],t=0;t<n.length;t++)i.push(n[t]);return i}function i(n){if(n){var t=window.getComputedStyle(n);return t&&t.display=="none"?!0:i(n.parentElement)}return!1}function o(n){for(var r,e=t(n.querySelectorAll(u)),f=0;f<e.length;f++)if(r=e[f],!i(r)&&r.tabIndex!=-1)return r;return null}var r="#b_results h2 a,#b_results h3 a,#b_results h4 a",u="input, select, textarea,a[href],*[tabindex = '0']",f=r+",#b_results .b_ans,#b_content #b_pole";n.getSelectableElements=e})(HeaderPlusAlgo_Selector||(HeaderPlusAlgo_Selector={}));NavSelector=HeaderPlusAlgo_Selector.getSelectableElements
|
1
test/static_tests/html/bing3_files/c9cd4dc5.js
Normal file
4
test/static_tests/html/bing3_files/cb3dd66f.svg
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
<svg focusable="false" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16">
|
||||||
|
<path d="M0 0h16v16h-16z" fill="none"/>
|
||||||
|
<path d="M8 1a7 7 0 1 0 7 7 7 7 0 0 0-7-7zm1 10a1 1 0 0 1-2 0v-3a1 1 0 0 1 2 0zm-.293-5.293a1 1 0 1 1 .293-.707 1 1 0 0 1-.293.707z" fill="#767676"/>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 282 B |
1
test/static_tests/html/bing3_files/cb6d16d8.js
Normal file
BIN
test/static_tests/html/bing3_files/d0c501ec.jpg
Normal file
After Width: | Height: | Size: 9.7 KiB |
BIN
test/static_tests/html/bing3_files/d6b2e5a9.jpg
Normal file
After Width: | Height: | Size: 16 KiB |
5
test/static_tests/html/bing3_files/d7ffd2fd.svg
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
<svg width="20px" height="16px" viewBox="0 0 20 16" focusable="false" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||||
|
<g transform="translate(-10, -12)" fill="#007DAA" >
|
||||||
|
<path d="M28.125,14.4615385 L25,14.4615385 L24.26875,13.0203077 C23.95125,12.3950769 23.30125,12 22.59125,12 L17.40875,12 C16.69875,12 16.04875,12.3950769 15.73125,13.0203077 L15,14.4615385 L11.875,14.4615385 C10.84,14.4615385 10,15.2886154 10,16.3076923 L10,26.1538462 C10,27.1729231 10.84,28 11.875,28 L28.125,28 C29.16,28 30,27.1729231 30,26.1538462 L30,16.3076923 C30,15.2886154 29.16,14.4615385 28.125,14.4615385 Z M20,25.5384615 C17.23875,25.5384615 15,23.3341538 15,20.6153846 C15,17.8966154 17.23875,15.6923077 20,15.6923077 C22.76125,15.6923077 25,17.8966154 25,20.6153846 C25,23.3341538 22.76125,25.5384615 20,25.5384615 Z M20,18.1538462 C18.62125,18.1538462 17.5,19.2578462 17.5,20.6153846 C17.5,21.9729231 18.62125,23.0769231 20,23.0769231 C21.37875,23.0769231 22.5,21.9729231 22.5,20.6153846 C22.5,19.2578462 21.37875,18.1538462 20,18.1538462 Z"></path>
|
||||||
|
</g>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 1.1 KiB |
1
test/static_tests/html/bing3_files/db475c97.js
Normal file
@ -0,0 +1 @@
|
|||||||
|
var Swipe;(function(n){function i(n){var i=null,e,r,u,f;return"touches"in n?(e=n,r=e.targetTouches,r&&r.length==1&&(i={pageX:r[0].pageX,pageY:r[0].pageY})):t?(u=n,i={pageX:u.clientX,pageY:u.clientY}):(f=n,i={pageX:f.pageX,pageY:f.pageY}),i!=null&&(i.pageY+=_w.pageYOffset),i}function r(n){var e="getSelection",f=_w[e]||_d[e],t="",i,r,o,u;return f?(i=f(),t+=f(),n&&t!==""&&i.getRangeAt&&(r=i.getRangeAt(0),o=r&&r.getClientRects&&r.getClientRects.length,o>0&&i.removeAllRanges())):_d.selection&&(u=_d.selection,t+=u.createRange().text,n&&t!==""&&u.empty&&u.empty()),!!t}function e(n){sj_pd(n);r(!0)}function o(n,e,o,s,h,c,l,a,v,y){var w,rt,ut,it;o===void 0&&(o=_d.body);s===void 0&&(s=50);h===void 0&&(h=function(){});c===void 0&&(c=function(){});l===void 0&&(l=function(){});a===void 0&&(a=!1);v===void 0&&(v=!1);y===void 0&&(y=2);y=Math.max(y,2);var p=new u,b=null,k="touchstart",d="touchmove",g="touchend",nt="touchout",tt=a||!f;"ontouchstart"in _d.documentElement?(k="touchstart",d="touchmove",g="touchend",nt="touchout"):t&&(b=new MSGesture,b.target=o,o.style.msTouchAction="none",o.style.touchAction="none",w=!!_w.PointerEvent,k=w?"pointerdown":"MSPointerDown",d="MSGestureChange",g=w?"pointerup":"MSPointerUp",nt=w?"pointerout":"MSPointerOut");rt=function(n){if(t&&n.pointerId){if(n.pointerType!="touch")return;b.addPointer(n.pointerId)}(p.start=i(n),p.start)&&(p.lastUpdate=p.start,p.speed=0,p.lastTime=(new Date).getTime(),tt||n.preventDefault&&n.preventDefault(),l&&l(),Log.Log("Start","Swipe",n.type,!0),sj_sp(n))};sj_be(o,k,rt);ut=function(n){var t,r,u,f,e,o;if(p.lastUpdate!=null&&p.start!=null){if(t=i(n),p.start!==null&&t!=null){if(r=t.pageX-p.start.pageX,u=t.pageY-p.start.pageY,v){if(Math.abs(u)>Math.abs(r)*2)return;n.preventDefault&&n.preventDefault()}p.total.pageX=r;p.total.pageY=u;h&&(f=t.pageX-p.lastUpdate.pageX,e=t.pageY-p.lastUpdate.pageY,h(f,e),o=(new Date).getTime(),p.speed=f/(o-p.lastTime),p.lastUpdate=t)}sj_sp(n)}};sj_be(o,d,ut);it=function(t){var i,u,f;if(p.start!==null&&!r(!1)){if(i=Math.abs(p.total.pageX),i==0&&tt)return;i>=s&&(i>Math.abs(p.total.pageY)*y||v)?(p.total.pageX<0&&e&&e(p.speed),p.total.pageX>0&&n&&n(p.speed)):!tt&&i<=5&&Math.abs(p.total.pageY)<=5?(u=t.target,_d&&_d.createEvent&&(f=_d.createEvent("HTMLEvents"),f.initEvent("click",!0,!0),u.dispatchEvent(f)),u.click&&u.click()):c&&c(p.speed);Log.Log("End","Swipe",t.type,!0,"PX",p.total.pageX.toString(),"PY",p.total.pageY.toString())}p.start=null;p.total.pageX=0;p.total.pageY=0;p.speed=0;sj_sp(t)};sj_be(o,nt,it);sj_be(o,g,it)}function s(n){return navigator.userAgent.match(n)}function h(){var t=-1,i,n;try{i=/Chrome\/(\d+).*/i;n=i.exec(navigator.userAgent);n&&n[1]&&(t=parseInt(n[1]))}catch(r){t=-1}return t}function c(){if(s(/Android/i)){var n=h();if(n<=36)return!0}return!1}var u=function(){function n(){this.start=null;this.total={pageX:0,pageY:0,clientX:0,clientY:0};this.lastUpdate=null;this.speed=0}return n}(),t=_w.MSGestureEvent&&_w.MSGesture,f=c();n.StopEffect=e;n.OnSwipe=o})(Swipe||(Swipe={}))
|