Need help!
I create a problem of collecting / parsing / scraping the weather data on the current day from www.foreca.com and the subsequent voice output.
For parseing / scraping, I decided to use JavaScriptle, and the JS jQuery library. And to receive the DOM (HTML) web pages using HTTP Request, since JavaScript is done very difficult to do this due to the CORS error.
The parser script itself, checked it in the browser (downloaded HTML pages and attached this parser-script to it with the data output to the console for visibility), as well as in Node JS (used with the Cheerio library).
Here is the abbreviated version of the script (the full version is oversaturated with variables):
$(function() {
var town = $('div').eq(27).children('h1').text();
var temper = $('div').eq(30).children('span').text();
});
And the abbreviated version of the descriptor (the full version is oversaturated with variables):
Weather (24)
A1: HTTP Request [ Method:GET
URL:https://www.foreca.com Headers: Query Parameters: Body: File To
Send: File/Directory To Save With Output: Timeout (Seconds):30 Trust Any
Certificate:On Automatically Follow Redirects:Off Use Cookies:On ]
A2: JavaScriptlet [ Code:$(function() {
var town = $('div').eq(27).children('h1').text();
var temper = $('div').eq(30).children('span').text();
}); Libraries:https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js Auto Exit:On Timeout (Seconds):10 ]
A3: Say [ Text: Temperature in
%town: %temper,
Engine:Voice:default:default Stream:3 Pitch:5 Speed:5 Respect Audio Focus:On Network:Off Continue Task Immediately:Off ]
I can't understand how to rain jQuery Parser (DOM) HTML pages located in the% http_data variable ???
I apologize for my bad English. This google translator.