1

I am using power automate to read part of secured webpage content using http with Azure AD. I am able to get whole webpage content as text. I am trying to get part of web page text inside a paragraph with id or with a xpath like the below. I tried checking searching connectors for options like read html, read webpage etc but could not find related to add a step. Any suggestion or pointer to read part of webpage using xpath from result of "http with azure ad" connector. The call is not for an API. The call I am trying is for a webpage.

I did the following: Created a http with azure ad connector with name 'Get web resource'. Successfully signed in with azure ad and able to get content. used Content = body('Get_web_resource') used Content as part of email body to trigger email message Example xpath: //*[@id="Content"]/here/section[3]/ul/li/p Any option like split if we have challenges xpath option Content return type: https://learn.microsoft.com/en-us/connectors/webcontents/#binary

Kurkula
  • 6,386
  • 27
  • 127
  • 202
  • Unfortunately, you can't use xpath, only in XML. – ojonasplima Nov 05 '22 at 22:32
  • 2
    Can you share a screenshot/code snippet of the webpage data you are trying to process? Also a screenshot of your current flow setup would be useful. Power Automate has a lot of different expression functions which might be useful in this use case, https://aka.ms/logicexpressions#xpath, https://aka.ms/logicexpressions#indexOf or https://aka.ms/logicexpressions#split. If you can share a bit more detail I can have a look if I can find something for you. – Expiscornovus Nov 09 '22 at 13:06
  • 1
    The problem with the logic expression `xpath` is that it requires valid XML and will choke on most valid XHTML/HTML. So your probably stuck with the string functions Expiscornovus listed above - https://learn.microsoft.com/en-us/azure/logic-apps/workflow-definition-language-functions-reference#string-functions Is it possible for you to pass this off to an Azure Function to do the Xpath parsing? – mdp Nov 10 '22 at 15:59

0 Answers0