Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Auto filling

Posted on 2011-09-18
6
Medium Priority
?
360 Views
Last Modified: 2012-05-12
I am trying to write a perl script to auto fill on a forum using WWW::Mechanize;
___________________________________________
use WWW::Mechanize;
$mech = WWW::Mechanize->new();
$input1 = "TITLE";
$input2 = "BODY";
$mech->get("URL");
$mech->form_with_fields(("subject","XXXX"));
$mech->field("subject",$input1);
$mech->field("XXXX",$input2);
$mech->submit_form();
_______________________________________________

From the source code of the webpage I came to know that TITLE "name=subject", but I am unable to find the name of the "BODY", for your reference I am attaching a screenshot of the BODY.

Can someone help me in finding the name of BODY?
 BODY Image
0
Comment
Question by:pravink22
  • 3
  • 3
6 Comments
 

Author Comment

by:pravink22
ID: 36556525
This is the code I found on source of the body:

<body id="tinymce" class="mceContentBody  wp-editor" dir="ltr"><p><br data-mce-bogus="1"></p></body>
0
 
LVL 23

Expert Comment

by:nemws1
ID: 36556722
I think maybe you need to look for a TEXTAREA form element instead.
0
 
LVL 23

Expert Comment

by:nemws1
ID: 36556771
Can you post the HTML Code of the entire FORM (from <FORM...> to </FORM>)?
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:pravink22
ID: 36556913
its a wordpress, admin posting page
0
 
LVL 23

Accepted Solution

by:
nemws1 earned 2000 total points
ID: 36557002
Ah, the id & name for that is simply 'content' (easily found using Firefox w/ the Web Developer add-on and calling Web Developer -> Forms -> Display Form Details) .  Looking at Post submission page in one of my WordPress installs, I'd do something like this (I don't see a 'subject' field in mine, but I do see a 'title'):
use WWW::Mechanize;
$mech = WWW::Mechanize->new();
$input1 = "TITLE";
$input2 = "BODY";
$mech->get("url.to.wordpress/post-new.php");
$mech->form_with_fields(("title","content"));
$mech->field("title",$input1);
$mech->field("content",$input2);
$mech->submit_form();

Open in new window

0
 

Author Comment

by:pravink22
ID: 36558069
Its works Gr8... Thanks for sharing... :)
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

On Microsoft Windows, if  when you click or type the name of a .pl file, you get an error "is not recognized as an internal or external command, operable program or batch file", then this means you do not have the .pl file extension associated with …
Email validation in proper way is  very important validation required in any web pages. This code is self explainable except that Regular Expression which I used for pattern matching. I originally published as a thread on my website : http://www…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
Six Sigma Control Plans

885 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question