Solved

Auto filling

Posted on 2011-09-18
6
351 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
Comment Utility
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
Comment Utility
I think maybe you need to look for a TEXTAREA form element instead.
0
 
LVL 23

Expert Comment

by:nemws1
Comment Utility
Can you post the HTML Code of the entire FORM (from <FORM...> to </FORM>)?
0
Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

 

Author Comment

by:pravink22
Comment Utility
its a wordpress, admin posting page
0
 
LVL 23

Accepted Solution

by:
nemws1 earned 500 total points
Comment Utility
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
Comment Utility
Its works Gr8... Thanks for sharing... :)
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

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 …
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…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…

771 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now