Support Portal

for ProcessRobot and WinAutomation

Start a new topic
Answered

Cannot get XML Element or Attributes using valid Xpath Queries

I am trying to write to an XML document but I am having no luck using Xpath Queries that work in online testers like https://codebeautify.org/Xpath-Tester#xpath-examples.


My XML has been validated and is error free. Have included image of the XML but here is the opening part as text:


image

image

image

<?xml version="1.0" encoding="UTF-8"?>

<Pages xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="pages.xsd">

  <Page HTMLTitle="Local SEO Brisbane" MetaDescription="This is a meta description and it also isn't." Parent="Qld" Slug="brisbane">

    <Location Country="Australia" State="Qld" City="Brisbane" LocGovWebsite="https://www.brisbane.qld.gov.au" StateGovWebsite="https://www.qld.gov.au">

      <Seek SeekIconURL="https://api.faviconkit.com/www.truelocal.com.au/144" IconAlt="Site Logo" SeekGeoURL="https://www.seek.com.au/jobs/in-Brisbane" />

      <Gumtree GumtreeIconURL="https://api.faviconkit.com/https://www.gumtree.com.au/144" IconAlt="Site Logo" GumtreeGeoURL="https://www.gumtree.com.au/s-brisbane/k0l3005721" />

      <Whirlpool WhirlpoolIconURL="https://api.faviconkit.com/https://whirlpool.net.au/144" IconAlt="Site Logo" WhirlpoolGeoURL="https://forums.whirlpool.net.au/forum/?action=search&amp;f=135&amp;q=Brisbane" />


Best Answer

Slight correction to Adam's answer


XPathQuery: /Pages/Page

Attribute Name: HTMLTitle


This should do the job.


Hi guys


I appreciate that you finally offered some advice but I found a solution myself within a few days of my post...was a pretty cool bot - it scraped data from 8 different sites and then used that data to completely build about 40 pages with content for SEO targeting towns and cities in Australia.

ADMIN
Answer

Slight correction to Adam's answer


XPathQuery: /Pages/Page

Attribute Name: HTMLTitle


This should do the job.

I found that you don't need the "@" for this. I believe WinAuto/PR already drops that in.


XPathQuery: /Pages/Page/

Attribute Name: HTMLTitle


1 person likes this
Login or Signup to post a comment