F
fiazidris
Previously, I have written a perl script to access data from this URL:
http://www.bangkokflightservices.com/our_cargo_track.php
Some sample: MAWB - Master Airwaybill Number
724-26332482
724-61480672
724-61441122
and this was the final URL:
http://203.151.118.123:8090/showc_track.php?m_prefix=724&m_sn=26332482&h_prefix=HWB&h_sn=
But, now there is a change on the website and I couldn't extract
through the same script. One change I noticed is the URL has changed
to:
<iframe src="http://203.151.118.123:8090/showc_track.php?
m_prefix=724&m_sn=26332482&h_prefix=HWB&h_sn=&ecy=e076438db64c6190f7b9689a379b7f7093368f1652d14db65fee1ab916713f3f5f4030f53369cb1f669614312c4748899c272f4d976a2b299274a21ad80fc072b1bab2ab1c181d08c670188722e51ec162f9ae337e3f2f132c88d249133815558d241ce8a4e9b3fa75c144268b9e901037c2c7257142ee42ff9b2bf2767f57ed62b94fd938ea4dd2b28c53fea6af74be&ch=
" frameborder="0" scrolling="yes" height="700" width="100%"> </iframe>
How can I programmatically obtain data for a list of MAWBs.
Here is a sample script that I wrote which previously worked:
#!/usr/bin/perl
while (<>) {
chomp;
$mprefix = substr($_, 0, 3);
$msn = substr($_, 4, 8);
if (length($mprefix) ne 3) { next; }
$currurl = 'http://203.151.118.123:8090/showc_track.php?
m_prefix=' . $mprefix . '&m_sn=' . $msn .
'&h_prefix=HWB&h_sn=&ecy=e076438db64c6190f7b9689a379b7f7093368f1652d14db65fee1ab916713f3f5f4030f53369cb1f669614312c4748899c272f4d976a2b299274a21ad80fc072b1bab2ab1c181d08c670188722e51ec162f9ae337e3f2f132c88d249133815558d241ce8a4e9b3fa75c144268b9e901037c2c7257142ee42ff9b2bf2767f57ed62b94fd938ea4dd2b28c53fea6af74be&ch=
';
$currresult = qx{curl -s '$currurl'};
while ( $currresult=~ m#(.*)#g ) {
$currline=$1;
if ($currline =~ m#style12#i) {
$currline =~ m#.*>(.*?)<.*#i;
$result = $result . " / " . $1;
}
}
print "***$result\n";
$result = '';
}
http://www.bangkokflightservices.com/our_cargo_track.php
Some sample: MAWB - Master Airwaybill Number
724-26332482
724-61480672
724-61441122
and this was the final URL:
http://203.151.118.123:8090/showc_track.php?m_prefix=724&m_sn=26332482&h_prefix=HWB&h_sn=
But, now there is a change on the website and I couldn't extract
through the same script. One change I noticed is the URL has changed
to:
<iframe src="http://203.151.118.123:8090/showc_track.php?
m_prefix=724&m_sn=26332482&h_prefix=HWB&h_sn=&ecy=e076438db64c6190f7b9689a379b7f7093368f1652d14db65fee1ab916713f3f5f4030f53369cb1f669614312c4748899c272f4d976a2b299274a21ad80fc072b1bab2ab1c181d08c670188722e51ec162f9ae337e3f2f132c88d249133815558d241ce8a4e9b3fa75c144268b9e901037c2c7257142ee42ff9b2bf2767f57ed62b94fd938ea4dd2b28c53fea6af74be&ch=
" frameborder="0" scrolling="yes" height="700" width="100%"> </iframe>
How can I programmatically obtain data for a list of MAWBs.
Here is a sample script that I wrote which previously worked:
#!/usr/bin/perl
while (<>) {
chomp;
$mprefix = substr($_, 0, 3);
$msn = substr($_, 4, 8);
if (length($mprefix) ne 3) { next; }
$currurl = 'http://203.151.118.123:8090/showc_track.php?
m_prefix=' . $mprefix . '&m_sn=' . $msn .
'&h_prefix=HWB&h_sn=&ecy=e076438db64c6190f7b9689a379b7f7093368f1652d14db65fee1ab916713f3f5f4030f53369cb1f669614312c4748899c272f4d976a2b299274a21ad80fc072b1bab2ab1c181d08c670188722e51ec162f9ae337e3f2f132c88d249133815558d241ce8a4e9b3fa75c144268b9e901037c2c7257142ee42ff9b2bf2767f57ed62b94fd938ea4dd2b28c53fea6af74be&ch=
';
$currresult = qx{curl -s '$currurl'};
while ( $currresult=~ m#(.*)#g ) {
$currline=$1;
if ($currline =~ m#style12#i) {
$currline =~ m#.*>(.*?)<.*#i;
$result = $result . " / " . $1;
}
}
print "***$result\n";
$result = '';
}