我有以下请求:
$request = Invoke-WebRequest -Uri "https://........" `
$requestEncode = $request.ParsedHtml.documentElement.innerHtml
$requestEncode
这给了我回报:
// Toggle visible state of elements function replaceHeroContentWithResults() { const
results = document.querySelector(".hero__results"); const heroContent = document.qu
erySelector(".hero__content"); results.classList.toggle("is-hidden"); heroContent.cl
assList.toggle("is-hidden"); } // Display the results of the seach function renderRe
sultsPartial() { const results = document.querySelector(".hero__results"); results.i
nnerHTML = "<SECTION class='\"results' dark-theme\?>\n <HEADER class='\"results__hea
der\"'>\n
<H2 class='\"results__title\"'>Search Results<\/h2>\n
<DIV class='\"results__nav\"'>\n
<P class='\"results__subtitle\"'>Your search contained one ingredient known to promo
te the growth of malassezia.<\/p>\n <\/div>\n <\/header>\n\n
<TABLE class='\"results__table\"'>\n
<TBODY>\n
<TR>\n
<TH scope='\"col\"'>ingredient name<\/th>\n
<TH scope='\"col\"'>category<\/th>\n <\/tr>\n\n
<TR>\n
<TH scope='\"row\"' data-label='\"name\"'>\n <SPAN class='\"type-of' lipids\?>\n ole
a europaea (olive) fruit oil\n <\/span>\n <\/th>\n </SPAN>
<TD data-label='\"category\"'>\n <SPAN class='\"type-of' lipids\?>\n Lipids\n <\/
span>\n <\/td>\n <\/tr>\n <\/tbody>\n <\/table>\n\n <SECT
ION class='\"results__comments\"'>\n <\/section>\n\n <SECTION class='\"results
__footer\"'>\n <A href='\"/search-again\"' data-remote='\"true\"'>Search again<\/
a>\n <\/section>\n<\/section>\n"; } // Reset search form function res
etSearchForm() { const search = document.querySelector(".jsSearchForm"); search.rese
t(); } replaceHeroContentWithResults(); resetSearchForm(); renderResultsPartial(); <
/A></SPAN></TR></TBODY></P></DIV></H2>
它没有被解析,因为当我输入-UseBasicParsing时它不起作用,我的问题是如何从该 html 中选择一个元素,例如“成分名称”