Im trying to fill out the 'form' on the twitter search home page (link in the code defined as $url) its very basic a box for what you want to search and a search button. But its giving me a lot of difficulty, I cant seem to get it to work. Here is the portion of my script where i'm filling out the 'form'
my $mech = WWW::Mechanize->new();
my $url = "https://twitter.com/search-home";
blah. blah. blah.
$mech->get($url);
$mech->submit_form(
form_number=> 1,
fields => {
query => $tweetsearch,
button => "Search",
}
);
print $mech->uri();
When it prints it, it prints out $url meaning it didnt do anything where it should print https://twitter.com/searchsrc=typd&q=from%3Anikestore%20%22jordan%22%20%22concord%22%20%22now%20available%22%20since%3A2014-5-2 Any help?
You're using wrong form:
$mech->submit_form(
form_id => "search-home-form",
fields => {
q => "#YourTimeHasCome #MVP #NBA2K15",
},
);