1

When I make the call, the response coming back has no form or input fields. Is there another way to post data without a form? Or do I have an incorrect $url? What am I missing?

$c = Invoke-WebRequest -Uri $url -WebSession $sess_var
$c.forms.count

Output is zero for the form count. I have also tried to set fields like below and post with -Body $form3 (gave an error):

$form3 = $c.Forms[0]
$form3.somefieldIknow = "good value"

EDIT: The website is internal to my network and is not visible to the outside. Here is a snippet from the output from $c, hopefully this may help. I downloaded Fiddler but its not showing fields for some reason. I am not able to decipher below. Maybe someone can lend a hand. thanks.

ParsedHtml        : mshtml.HTMLDocumentClass 
Forms             : {} 
InputFields       : {@{innerHTML=; innerText=; outerHTML=<INPUT id=arid302889100 class="text f9 dat" style="HEIGHT: 21px; 
                    WIDTH: 31px; LEFT: 0px; TOP: 0px" readOnly>; outerText=; tagName=INPUT; id=arid302889100; class=text 
                    f9 dat; style=HEIGHT: 21px; WIDTH: 31px; LEFT: 0px; TOP: 0px; readOnly=},

Links             : {@{innerHTML=<IMG class=tbright alt="Show toolbar" src="../../../../resources/images/mt_sprites.gif"><IMG class=tbdown alt="Hide toolbar"                     src="../../../../resources/images/mt_sprites.gif">; innerText=;  outerHTML=<A class="btn TBTopBarBox" 
                    href="javascript:"><IMG class=tbright alt="Show toolbar"
Mark Schultheiss
  • 32,614
  • 12
  • 69
  • 100
Wei Wei
  • 99
  • 2
  • 10
  • You can post any data you want. The question is what does your URL expect in the post data? – briantist Mar 30 '16 at 19:07
  • I am trying to figure that part out. Going in through the website, I know there are certain fields, which I tried to set. Maybe a better question is how to figure what the URL expects? – Wei Wei Mar 30 '16 at 19:31
  • Well, we don't know what the web site is, so we can't look at it. You might be able to tell by using the web site and then capturing all the traffic as you submit. There isn't enough information here for us to help. – briantist Mar 30 '16 at 19:34

0 Answers0