Solved

Auto filling

Posted on 2011-09-18
6
355 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
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!

 

Author Comment

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

Accepted Solution

by:
nemws1 earned 500 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

Secure Your Active Directory - April 20, 2017

Active Directory plays a critical role in your company’s IT infrastructure and keeping it secure in today’s hacker-infested world is a must.
Microsoft published 300+ pages of guidance, but who has the time, money, and resources to implement? Register now to find an easier way.

Question has a verified solution.

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

Suggested Solutions

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…
There are many situations when we need to display the data in sorted order. For example: Student details by name or by rank or by total marks etc. If you are working on data driven based projects then you will use sorting techniques very frequently.…
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…

749 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