Skip to content

Invoke-WebRequest Example 1 No InputFields Returned #10829

@beingmerry

Description

@beingmerry

Type of issue

Outdated article

Feedback

The code mentioned in the first example works correctly, but the returned InputFields from Bing do not contain any names matching "* Value". I think this is because Bing changed how the input fields are loaded / presented on the page.

When navigating directly to the link, those fields do exist. When I look through the $Response HTML, I can not find the input fields that were present on the web page.

Code used:

$Response = Invoke-WebRequest -URI https://www.bing.com/search?q=how+many+feet+in+a+mile
$Response.InputFields | Where-Object {
    $_.name -like "* Value*"
} | Select-Object Name, Value

Expected Response:

name       value
----       -----
From Value 1
To Value   5280

Actual Response:
None

Screenshot of debugger $Response object:
image

Page URL

https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.utility/invoke-webrequest?view=powershell-7.4

Content source URL

https://github.com/MicrosoftDocs/PowerShell-Docs/blob/main/reference/7.4/Microsoft.PowerShell.Utility/Invoke-WebRequest.md

Author

@sdwheeler

Document Id

b2e7e015-35b9-897c-3581-ad982240c97c

Metadata

Metadata

Assignees

Labels

area-utilityArea - Microsoft.PowerShell.Utility module

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions