How to get started
- download the zip
- unzip downloaded file
- cd to unzipped dir
- chmod +x test-ua.pl
- Run ./test-ua.pl www.google.com
Depends on: perl and wget
Add more browsers by editing/adding to browsers.txt
How to get started
Depends on: perl and wget
Add more browsers by editing/adding to browsers.txt
chrome-win-60:Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.113 Safari/537.36 | |
wget-1.20:Wget/1.20.3 (linux-gnu) |
#!/usr/bin/perl | |
use warnings; | |
use strict; | |
if (! defined($ARGV[0])){ | |
die "Usage:\n$0 http://example.com/\n"; | |
} | |
my $url = $ARGV[0]; | |
open(UA_FH,"< browsers.txt") || die "Create UA file 'browsers.txt' with lines of \$BrowserName:\$UseragentString"; | |
while(my $line = <UA_FH>) { | |
chomp $line; | |
my ($browser_name, $browser_ua) = split(":", $line); | |
system("wget -U '$browser_ua' -O $browser_name.html $url "); | |
} |