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.
my $res=
  Mojo::UserAgent->new->get('http://example.com')->res->dom;

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
url;title;
url2;title2;
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 .

-- 
You received this message because you are subscribed to the Google Groups 
"Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/mojolicious.
For more options, visit https://groups.google.com/d/optout.

Reply via email to