Hi , i m beginner in Mojo. I have some expirience of php. Sorry if i use it for more understanding.
I m develop for self simple script scrapper.
Part 1; Scrape root elements
I have a page with a urls and titles in table html.
I need grab from this page all elements,
But i find in internet only this example . There i m find only text of element
my $texts =
$res->find('.tdcont td a')->map(sub { $_->text });
I need a create array or something else . Maybe csv file.
how i can create statement, when i need save from one element 2 or more data. For example
or in php(sorry)
array(array('url','title),array('url2','title2))
Part 2; Scrape child elements
When exists array or something else data . I need run another scrapp in loop .
For example(php):
foreach($data as $item) {
$url = $item[0];
$title = $item[1];
// there i need a parse elements
// go to url
doParseChild();
// there i need a exmaple how to check - exist element or not on page
if (pagination exists) {
//foreach ($pages as $page) {
doParseChild();
}
}
}
When first iteration of loop ended , go to second iteraion . etc..
Please help me , at least for a general understanding. Sorry for bad english and php .