Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Auto filling

Posted on 2011-09-18
6
Medium Priority
?
358 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 

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

Technology Partners: 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!

Question has a verified solution.

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

I have been pestered over the years to produce and distribute regular data extracts, and often the request have explicitly requested the data be emailed as an Excel attachement; specifically Excel, as it appears: CSV files confuse (no Red or Green h…
In the distant past (last year) I hacked together a little toy that would allow a couple of Manager types to query, preview, and extract data from a number of MongoDB instances, to their tool of choice: Excel (http://dilbert.com/strips/comic/2007-08…
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

688 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