Skip to content

Commit 707c3a8

Browse files
committed
Added crawling for google results (LWP + Mojo)
1 parent c406926 commit 707c3a8

File tree

5 files changed

+248
-3
lines changed

5 files changed

+248
-3
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,6 @@ Hopefully will work on older version too (as old as 5.10) and across diferent OS
134134
| Catalyst |
135135
| Dancer2 |
136136
| Mojolicious |
137-
| Web Crawling <ul><li>Stock Price LWP</li></ul><ul><li>Stock Price Mechanize</li></ul><ul><li>Stock Price Mojo</li></ul> | Completed |
137+
| Web Crawling <ul><li>Crawl Google Resilts LWP</li></ul><ul><li>Crawl Google Resilts Mojo</li></ul><ul><li>Stock Price LWP</li></ul><ul><li>Stock Price Mechanize</li></ul><ul><li>Stock Price Mojo</li></ul> | Completed |
138138
| Currency Converter <ul><li>LWP::UserAgent</li></ul><ul><li>Mojo::UserAgent</li></ul> | Completed |
139139
| Weather <ul><li>LWP::UserAgent</li></ul><ul><li>Mojo::UserAgent</li></ul> | Completed |
Lines changed: 126 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
1+
#!/usr/bin/env perl
2+
# Search google with a keyword and get all the anchor links and text in search results.
3+
4+
# https://metacpan.org/pod/LWP::UserAgent
5+
# https://metacpan.org/pod/HTML::TreeBuilder
6+
7+
use strict;
8+
use warnings;
9+
use Carp qw( croak );
10+
use LWP::UserAgent ();
11+
use HTML::TreeBuilder;
12+
13+
sub crawl_results {
14+
my ($ua, $url) = @_;
15+
my $response = $ua->get($url);
16+
17+
if ($response->is_success) {
18+
my $tree = HTML::TreeBuilder->new();
19+
$tree->parse($response->decoded_content);
20+
21+
# https://metacpan.org/pod/HTML::Element#look_down
22+
# We will be getting the 'anchor' tag which is inside the 'div' tag having class 'kCrYT'
23+
my @anchor_tags = $tree->look_down(
24+
'_tag' => 'a',
25+
sub {
26+
$_[0]->look_up('_tag' => 'div', 'class' => 'kCrYT');
27+
}
28+
);
29+
for my $anchor (@anchor_tags) {
30+
my $anchor_text
31+
= $anchor->look_down('_tag' => 'div', 'class' => 'BNeawe vvjwJb AP7Wnd');
32+
if (defined $anchor_text) {
33+
print $anchor_text->as_text() . "\n " . $anchor->attr('href') . "\n";
34+
}
35+
else {
36+
$anchor_text
37+
= $anchor->look_down('_tag' => 'span', 'class' => 'XLloXe AP7Wnd');
38+
print " " . $anchor_text->as_text() . "\n " . $anchor->attr('href') . "\n";
39+
}
40+
41+
}
42+
}
43+
else {
44+
croak $response->status_line;
45+
}
46+
}
47+
48+
sub main {
49+
my $search_text = "Perl";
50+
my $url = "https://www.google.com/search?q=" . $search_text;
51+
52+
my $ua = LWP::UserAgent->new(ssl_opts => {verify_hostname => 0});
53+
$ua->show_progress(1);
54+
55+
$ua->agent('Mozilla/5.0');
56+
57+
crawl_results($ua, $url);
58+
}
59+
60+
main();
61+
62+
63+
__END__
64+
65+
Output-
66+
67+
The Perl Programming Language - www.perl.org
68+
/url?q=https://www.perl.org/&sa=U&ved=2ahUKEwjnosLT6PXtAhW6yjgGHVOqAlcQFjAAegQIBRAB&usg=AOvVaw3y3nT09Oz2w6kikznVIuMh
69+
Perl Download
70+
/url?q=https://www.perl.org/get.html&sa=U&ved=2ahUKEwjnosLT6PXtAhW6yjgGHVOqAlcQ0gIwAHoECAUQAg&usg=AOvVaw2gBE2LhG8ygDrly05ICUdw
71+
About
72+
/url?q=https://www.perl.org/about.html&sa=U&ved=2ahUKEwjnosLT6PXtAhW6yjgGHVOqAlcQ0gIwAHoECAUQAw&usg=AOvVaw24DsGYNiDr06YOm3I0ZMZK
73+
Learn Perl
74+
/url?q=https://www.perl.org/learn.html&sa=U&ved=2ahUKEwjnosLT6PXtAhW6yjgGHVOqAlcQ0gIwAHoECAUQBA&usg=AOvVaw3oJC7A0q1L2bBbAuV2vtLH
75+
Perl Blogs
76+
/url?q=http://blogs.perl.org/&sa=U&ved=2ahUKEwjnosLT6PXtAhW6yjgGHVOqAlcQ0gIwAHoECAUQBQ&usg=AOvVaw0NG5PstdaQ-LXgQF1xO527
77+
Wikipedia
78+
/url?q=https://en.wikipedia.org/wiki/Perl&sa=U&ved=2ahUKEwjnosLT6PXtAhW6yjgGHVOqAlcQmhMwEnoECBUQDg&usg=AOvVaw1Sj3QfRNbZWdksIJMDVpRQ
79+
Perl.com - programming news, code and culture
80+
/url?q=https://www.perl.com/&sa=U&ved=2ahUKEwjnosLT6PXtAhW6yjgGHVOqAlcQFjAcegQIBhAB&usg=AOvVaw1oMYhe_vApCBfMeull0wuW
81+
Perl - Wikipedia
82+
/url?q=https://en.wikipedia.org/wiki/Perl&sa=U&ved=2ahUKEwjnosLT6PXtAhW6yjgGHVOqAlcQFjAdegQICxAB&usg=AOvVaw1hl5JKfzPLO2SiuBF-1JjD
83+
History
84+
/url?q=https://en.wikipedia.org/wiki/Perl%23History&sa=U&ved=2ahUKEwjnosLT6PXtAhW6yjgGHVOqAlcQ0gIwHXoECAsQAg&usg=AOvVaw3TwYV8Wu_P33aqJ3zAfQxJ
85+
Overview
86+
/url?q=https://en.wikipedia.org/wiki/Perl%23Overview&sa=U&ved=2ahUKEwjnosLT6PXtAhW6yjgGHVOqAlcQ0gIwHXoECAsQAw&usg=AOvVaw22fnsL-FL2s9paSxHBL46G
87+
Database interfaces
88+
/url?q=https://en.wikipedia.org/wiki/Perl%23Database_interfaces&sa=U&ved=2ahUKEwjnosLT6PXtAhW6yjgGHVOqAlcQ0gIwHXoECAsQBA&usg=AOvVaw14s-sSUPwFEW6psKWbyUKF
89+
Larry Wall
90+
/url?q=https://en.wikipedia.org/wiki/Larry_Wall&sa=U&ved=2ahUKEwjnosLT6PXtAhW6yjgGHVOqAlcQs2YwHXoECAsQBw&usg=AOvVaw2cTISw6jscTZdSuSwsu0zO
91+
GNU General Public License
92+
/url?q=https://en.wikipedia.org/wiki/GNU_General_Public_License&sa=U&ved=2ahUKEwjnosLT6PXtAhW6yjgGHVOqAlcQs2YwHXoECAsQCQ&usg=AOvVaw22kEPvsqGJ-vhq4kl2ceZs
93+
Multi-paradigm
94+
/url?q=https://en.wikipedia.org/wiki/Multi-paradigm&sa=U&ved=2ahUKEwjnosLT6PXtAhW6yjgGHVOqAlcQs2YwHXoECAsQCw&usg=AOvVaw11J9SG-p_azhwtEbdSSfM4
95+
functional
96+
/url?q=https://en.wikipedia.org/wiki/Functional_programming&sa=U&ved=2ahUKEwjnosLT6PXtAhW6yjgGHVOqAlcQs2YwHXoECAsQDA&usg=AOvVaw3JtcSXpqWhgQGdra95zHeY
97+
imperative
98+
/url?q=https://en.wikipedia.org/wiki/Imperative_programming&sa=U&ved=2ahUKEwjnosLT6PXtAhW6yjgGHVOqAlcQs2YwHXoECAsQDQ&usg=AOvVaw0sYvOP4Klk4lgYTga4uAtM
99+
object-oriented
100+
/url?q=https://en.wikipedia.org/wiki/Object-oriented_programming&sa=U&ved=2ahUKEwjnosLT6PXtAhW6yjgGHVOqAlcQs2YwHXoECAsQDg&usg=AOvVaw06tbttIjQ5dAgMezRUf4XB
101+
class-based
102+
/url?q=https://en.wikipedia.org/wiki/Class-based_programming&sa=U&ved=2ahUKEwjnosLT6PXtAhW6yjgGHVOqAlcQs2YwHXoECAsQDw&usg=AOvVaw0KRak58-NGipywvgYlBAQX
103+
reflective
104+
/url?q=https://en.wikipedia.org/wiki/Reflective_programming&sa=U&ved=2ahUKEwjnosLT6PXtAhW6yjgGHVOqAlcQs2YwHXoECAsQEA&usg=AOvVaw14Tc5tx4Hy50wDmKq4CgQT
105+
Perl Tutorial - Tutorialspoint
106+
/url?q=https://www.tutorialspoint.com/perl/index.htm&sa=U&ved=2ahUKEwjnosLT6PXtAhW6yjgGHVOqAlcQFjAeegQICBAB&usg=AOvVaw0I4QvcKPi7pfpwWWsU1_B0
107+
Perl - Introduction
108+
/url?q=https://www.tutorialspoint.com/perl/perl_introduction.htm&sa=U&ved=2ahUKEwjnosLT6PXtAhW6yjgGHVOqAlcQ0gIwHnoECAgQAg&usg=AOvVaw0YWOpaHqZHQA07OLuwe_Tr
109+
Perl - Arrays
110+
/url?q=https://www.tutorialspoint.com/perl/perl_arrays.htm&sa=U&ved=2ahUKEwjnosLT6PXtAhW6yjgGHVOqAlcQ0gIwHnoECAgQAw&usg=AOvVaw0MC522KylwTVJc3RuiqG-f
111+
Perl - Environment
112+
/url?q=https://www.tutorialspoint.com/perl/perl_environment.htm&sa=U&ved=2ahUKEwjnosLT6PXtAhW6yjgGHVOqAlcQ0gIwHnoECAgQBA&usg=AOvVaw2vLcHLWFy4L3sg5Qh6sGmF
113+
Perl - Variables
114+
/url?q=https://www.tutorialspoint.com/perl/perl_variables.htm&sa=U&ved=2ahUKEwjnosLT6PXtAhW6yjgGHVOqAlcQ0gIwHnoECAgQBQ&usg=AOvVaw3oaQXhbe_qQuI_OFvhJ6W4
115+
Perl - Introduction - Tutorialspoint
116+
/url?q=https://www.tutorialspoint.com/perl/perl_introduction.htm&sa=U&ved=2ahUKEwjnosLT6PXtAhW6yjgGHVOqAlcQFjAfegQIChAB&usg=AOvVaw0rU8BKx99oTDNj6-guNTfa
117+
Perl Tutorial for Beginners: Learn in 1 Day - Guru99
118+
/url?q=https://www.guru99.com/perl-tutorials.html&sa=U&ved=2ahUKEwjnosLT6PXtAhW6yjgGHVOqAlcQFjAkegQIARAB&usg=AOvVaw2hhKV98I8svSTwlpoMPe6r
119+
Perl Programming Language - GeeksforGeeks
120+
/url?q=https://www.geeksforgeeks.org/perl-programming-language/&sa=U&ved=2ahUKEwjnosLT6PXtAhW6yjgGHVOqAlcQFjAlegQIABAB&usg=AOvVaw3C6q2gA836AhZ34l_evZKL
121+
Introduction to Perl - GeeksforGeeks
122+
/url?q=https://www.geeksforgeeks.org/introduction-to-perl/&sa=U&ved=2ahUKEwjnosLT6PXtAhW6yjgGHVOqAlcQFjAmegQIAxAB&usg=AOvVaw1--1qHvlQqS_SatxPjJwZt
123+
The Top 10 Programming Tasks That Perl Is Used For | By ActiveState
124+
/url?q=https://www.activestate.com/blog/top-10-programming-tasks-that-perl-is-used-for/&sa=U&ved=2ahUKEwjnosLT6PXtAhW6yjgGHVOqAlcQFjAnegQIDBAB&usg=AOvVaw1fO1A3eh2DrU5r0PcjjH_g
125+
Perl Tutorial
126+
/url?q=https://www.perltutorial.org/&sa=U&ved=2ahUKEwjnosLT6PXtAhW6yjgGHVOqAlcQFjAoegQIBxAB&usg=AOvVaw0rDSo8UlL65M1D3GGHpNrk
Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
#!/usr/bin/env perl
2+
# Search google with a keyword and get all the anchor links and text in search results.
3+
4+
# https://metacpan.org/pod/Mojo::UserAgent
5+
# https://metacpan.org/pod/Mojo::DOM
6+
7+
use strict;
8+
use warnings;
9+
use Carp qw( croak );
10+
use Mojo::UserAgent;
11+
12+
sub crawl_results {
13+
my ($ua, $url) = @_;
14+
my $response = $ua->get($url)->result;
15+
16+
if ($response->is_success) {
17+
18+
# https://docs.mojolicious.org/Mojo/DOM#find
19+
my $anchor_tags = $response->dom->find('div.kCrYT a');
20+
my $anchor_hrefs = $anchor_tags->map(attr => 'href');
21+
my $i = 0;
22+
for my $anchor ($anchor_tags->each) {
23+
my $parent_anchor_text = $anchor->find('div.BNeawe.vvjwJb.AP7Wnd')->map('text')->join("\n");
24+
my $child_anchor_text = $anchor->find('span.XLloXe.AP7Wnd')->map('text')->join("\n");
25+
if (defined $parent_anchor_text && $parent_anchor_text ne "") {
26+
print $parent_anchor_text . "\n";
27+
}
28+
else {
29+
print " " . $child_anchor_text . "\n";
30+
}
31+
print " " . $anchor_hrefs->[$i] . "\n";
32+
$i++;
33+
}
34+
}
35+
else {
36+
croak $response->message;
37+
}
38+
}
39+
40+
sub main {
41+
my $search_text = "Perl";
42+
my $url = "https://www.google.com/search?q=" . $search_text;
43+
my $ua = Mojo::UserAgent->new;
44+
45+
$ua->transactor->name('Mozilla/5.0');
46+
$ua->insecure(1);
47+
48+
crawl_results ($ua, $url);
49+
}
50+
51+
main();
52+
53+
54+
__END__
55+
56+
Output-
57+
58+
The Perl Programming Language - www.perl.org
59+
/url?q=https://www.perl.org/&sa=U&ved=2ahUKEwjn6JKcw_PtAhXUXSsKHUGFBvkQFjAAegQIBhAB&usg=AOvVaw1isbCIIVJVM-UWzr84aM6s
60+
Perl Download
61+
/url?q=https://www.perl.org/get.html&sa=U&ved=2ahUKEwjn6JKcw_PtAhXUXSsKHUGFBvkQ0gIwAHoECAYQAg&usg=AOvVaw1lu1-3zx6zsjHu7MkxT0Zf
62+
About
63+
/url?q=https://www.perl.org/about.html&sa=U&ved=2ahUKEwjn6JKcw_PtAhXUXSsKHUGFBvkQ0gIwAHoECAYQAw&usg=AOvVaw3o5Q-68_gEZ7js1v9bm3D8
64+
Learn Perl
65+
/url?q=https://www.perl.org/learn.html&sa=U&ved=2ahUKEwjn6JKcw_PtAhXUXSsKHUGFBvkQ0gIwAHoECAYQBA&usg=AOvVaw11edW8Ds7l2jb2vvca7RQE
66+
Perl Blogs
67+
/url?q=http://blogs.perl.org/&sa=U&ved=2ahUKEwjn6JKcw_PtAhXUXSsKHUGFBvkQ0gIwAHoECAYQBQ&usg=AOvVaw3opWhdIdw41ilTT63-FaqJ
68+
Wikipedia
69+
/url?q=https://en.wikipedia.org/wiki/Perl&sa=U&ved=2ahUKEwjn6JKcw_PtAhXUXSsKHUGFBvkQmhMwEnoECBUQDg&usg=AOvVaw0CvOCw80_ooV5y15ATthrB
70+
Perl.com - programming news, code and culture
71+
/url?q=https://www.perl.com/&sa=U&ved=2ahUKEwjn6JKcw_PtAhXUXSsKHUGFBvkQFjAcegQICxAB&usg=AOvVaw26g4cqX7RdeYfJB3BCutO3
72+
Perl - Wikipedia
73+
/url?q=https://en.wikipedia.org/wiki/Perl&sa=U&ved=2ahUKEwjn6JKcw_PtAhXUXSsKHUGFBvkQFjAdegQICRAB&usg=AOvVaw2op26ZZPgDAYHd58X2bQr0
74+
History
75+
/url?q=https://en.wikipedia.org/wiki/Perl%23History&sa=U&ved=2ahUKEwjn6JKcw_PtAhXUXSsKHUGFBvkQ0gIwHXoECAkQAg&usg=AOvVaw3qZ5G2DDfa1KZyv3efcF37
76+
Overview
77+
/url?q=https://en.wikipedia.org/wiki/Perl%23Overview&sa=U&ved=2ahUKEwjn6JKcw_PtAhXUXSsKHUGFBvkQ0gIwHXoECAkQAw&usg=AOvVaw0hWKZuhUv90C3yI2l6LgOM
78+
Perl 5
79+
/url?q=https://en.wikipedia.org/wiki/Perl%23Perl_5&sa=U&ved=2ahUKEwjn6JKcw_PtAhXUXSsKHUGFBvkQ0gIwHXoECAkQBA&usg=AOvVaw3busoJwzxZ_PvqFzhImLER
80+
Raku (Perl 6)
81+
/url?q=https://en.wikipedia.org/wiki/Perl%23Raku_(Perl_6)&sa=U&ved=2ahUKEwjn6JKcw_PtAhXUXSsKHUGFBvkQ0gIwHXoECAkQBQ&usg=AOvVaw0sIQUHQnf7r8pML8SB5R3p
82+
Larry Wall
83+
/url?q=https://en.wikipedia.org/wiki/Larry_Wall&sa=U&ved=2ahUKEwjn6JKcw_PtAhXUXSsKHUGFBvkQs2YwHXoECAkQCA&usg=AOvVaw1X-51UKDnnCV6EpWV65Wz1
84+
GNU General Public License
85+
/url?q=https://en.wikipedia.org/wiki/GNU_General_Public_License&sa=U&ved=2ahUKEwjn6JKcw_PtAhXUXSsKHUGFBvkQs2YwHXoECAkQCg&usg=AOvVaw2ruYZmCzQ4Js1Mj1DObefF
86+
Multi-paradigm
87+
/url?q=https://en.wikipedia.org/wiki/Multi-paradigm&sa=U&ved=2ahUKEwjn6JKcw_PtAhXUXSsKHUGFBvkQs2YwHXoECAkQDA&usg=AOvVaw04zd7pCr75X-yZtFCyxV-p
88+
functional
89+
/url?q=https://en.wikipedia.org/wiki/Functional_programming&sa=U&ved=2ahUKEwjn6JKcw_PtAhXUXSsKHUGFBvkQs2YwHXoECAkQDQ&usg=AOvVaw2inPQhkKY8lFFmAkOoJYR6
90+
imperative
91+
/url?q=https://en.wikipedia.org/wiki/Imperative_programming&sa=U&ved=2ahUKEwjn6JKcw_PtAhXUXSsKHUGFBvkQs2YwHXoECAkQDg&usg=AOvVaw12rYVsNSLXwgtbyyfw8RpC
92+
object-oriented
93+
/url?q=https://en.wikipedia.org/wiki/Object-oriented_programming&sa=U&ved=2ahUKEwjn6JKcw_PtAhXUXSsKHUGFBvkQs2YwHXoECAkQDw&usg=AOvVaw1LQ3NwKr_Hfrbr5GGkqD1e
94+
class-based
95+
/url?q=https://en.wikipedia.org/wiki/Class-based_programming&sa=U&ved=2ahUKEwjn6JKcw_PtAhXUXSsKHUGFBvkQs2YwHXoECAkQEA&usg=AOvVaw1hHmmh8YeuNvD26Os6tqxH
96+
reflective
97+
/url?q=https://en.wikipedia.org/wiki/Reflective_programming&sa=U&ved=2ahUKEwjn6JKcw_PtAhXUXSsKHUGFBvkQs2YwHXoECAkQEQ&usg=AOvVaw2JvxBufHA8_MvglqLI4xeG
98+
Perl - Introduction - Tutorialspoint
99+
/url?q=https://www.tutorialspoint.com/perl/perl_introduction.htm&sa=U&ved=2ahUKEwjn6JKcw_PtAhXUXSsKHUGFBvkQFjAeegQIChAB&usg=AOvVaw28_jv8jG9jRhAlqMNVwc6o
100+
Perl Tutorial - Tutorialspoint
101+
/url?q=https://www.tutorialspoint.com/perl/index.htm&sa=U&ved=2ahUKEwjn6JKcw_PtAhXUXSsKHUGFBvkQFjAfegQIBxAB&usg=AOvVaw2-bSusbAe1rP3H7tVSATCy
102+
Perl - Introduction
103+
/url?q=https://www.tutorialspoint.com/perl/perl_introduction.htm&sa=U&ved=2ahUKEwjn6JKcw_PtAhXUXSsKHUGFBvkQ0gIwH3oECAcQAg&usg=AOvVaw1QU4xuohw5iLt4q8VqPqQx
104+
Perl - File I/O
105+
/url?q=https://www.tutorialspoint.com/perl/perl_files.htm&sa=U&ved=2ahUKEwjn6JKcw_PtAhXUXSsKHUGFBvkQ0gIwH3oECAcQAw&usg=AOvVaw2TlJACGWpdYO2OuZXtjGdj
106+
Perl - Environment
107+
/url?q=https://www.tutorialspoint.com/perl/perl_environment.htm&sa=U&ved=2ahUKEwjn6JKcw_PtAhXUXSsKHUGFBvkQ0gIwH3oECAcQBA&usg=AOvVaw308KTV7gH4sjuXJn-LfpMM
108+
Perl - Arrays
109+
/url?q=https://www.tutorialspoint.com/perl/perl_arrays.htm&sa=U&ved=2ahUKEwjn6JKcw_PtAhXUXSsKHUGFBvkQ0gIwH3oECAcQBQ&usg=AOvVaw0c6dQaXAED-kbU2BrRz6HR
110+
Perl Tutorial for Beginners: Learn in 1 Day - Guru99
111+
/url?q=https://www.guru99.com/perl-tutorials.html&sa=U&ved=2ahUKEwjn6JKcw_PtAhXUXSsKHUGFBvkQFjAkegQIAxAB&usg=AOvVaw2T0Yc7vPd92QgQ4AFy1ecF
112+
Perl Programming Language - GeeksforGeeks
113+
/url?q=https://www.geeksforgeeks.org/perl-programming-language/&sa=U&ved=2ahUKEwjn6JKcw_PtAhXUXSsKHUGFBvkQFjAlegQIARAB&usg=AOvVaw1iWUVGrPuyCbgXN0J4P2l3
114+
Introduction to Perl - GeeksforGeeks
115+
/url?q=https://www.geeksforgeeks.org/introduction-to-perl/&sa=U&ved=2ahUKEwjn6JKcw_PtAhXUXSsKHUGFBvkQFjAmegQIABAB&usg=AOvVaw0kthF5nIvr-fY_jW9GoPwJ
116+
The Top 10 Programming Tasks That Perl Is Used For | By ActiveState
117+
/url?q=https://www.activestate.com/blog/top-10-programming-tasks-that-perl-is-used-for/&sa=U&ved=2ahUKEwjn6JKcw_PtAhXUXSsKHUGFBvkQFjAnegQICBAB&usg=AOvVaw0x_Pm__ZgAHVtYOplaaqQO
118+
Perl Tutorial
119+
/url?q=https://www.perltutorial.org/&sa=U&ved=2ahUKEwjn6JKcw_PtAhXUXSsKHUGFBvkQFjAoegQIBRAB&usg=AOvVaw02gYtL03ThK4quN1C1KG3G

web_programming/web_crawling/stock_price_lwp.pl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/usr/bin/env perl
2-
# https://metacpan.org/pod/WWW::Mechanize
2+
# https://metacpan.org/pod/LWP::UserAgent
33
# https://metacpan.org/pod/XML::LibXML
44

55
# We can use 'HTML::TreeBuilder' or 'XML::Twig' also here for parsing HTML.

web_programming/web_crawling/stock_price_mojo.pl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/usr/bin/env perl
2-
# https://metacpan.org/pod/Mojo::Useragent
2+
# https://metacpan.org/pod/Mojo::UserAgent
33
# https://metacpan.org/pod/Mojo::DOM
44

55
use strict;

0 commit comments

Comments
 (0)