I have to say I am new to Perl, maybe made about 3 or 4 scripts so far, and I find Perl decently easy to understand and use.
Anyways, I have a problem with my current script. I have been stuck on this problem for a while and just can't seem to find a fix for it.
After traversing a certain website I come to a page that has me click between two radio buttons and hit a download button.
I need to get my script to select either button and hit download, but the source of the page does not give me a value to set the radio button to when using WWW::Mechanize
.
Here is a little bit of the web page source.
<input type='radio' onclick="url('URL GOES HERE')">
That is pretty much it for the two buttons. I noticed that when I did choose one and looked at the source, the code changes to
<input type='radio' checked onclick="url('URL GOES HERE')">
Yet I can't have WWW::Mechanize
set one automatically because I have no idea what to put in the value. I have tried on
, checked
, onclick
, true
, checked onclick
, select
, selected
, but to no avail.
Here is the line of code that pertains to this
$mech->set_visible([radio => 'checked onclick']);
Any help would be appreciated, first time here as well.
I forgot to mention that I am working with a computer at work that has a lot of restrictions for now. So I can't get Firefox or Selenium Server on the computer.
Edit
I believe the problem that I might be having also is that this stuff might be in JavaScript. I don't have much knowledge in HTML but the source code looked like it was until I saw JavaScript somewhere in the heading? Anyways, I remembered that WWW::Mechanize
doesn't really support JavaScript and so maybe this is the problem.
Thanks for the replies guys, I really appreciated it. But after a ton of digging around and careful inspection, my boss and I sort of realized that all the download links are very similar, and all I really need to do is make the script custom create the links to the downloads instead of going through the hassle of taversing multiple web pages. Wish I saw this sooner.