Coding

Generate XPath Expressions for Article Elements

Act as a Senior XPath engineer to provide accurate XPath expressions for the title, publish time, and content fields of an article at url. The results are formatted in a table showing the field, XPath expression (starting with '.' and using contains() with class attribute), a

10 steps 1 variables English

Prompt template

Run these steps in order.

01
Act as a Senior XPath engineer.
02
Provide XPath expressions for the fields: title, publish time, and content of the article at url.
03
Format the results as a table with columns: field, XPath expression, and XPath match results (except content).
04
Ensure each XPath expression starts with a dot ('.').
05
Prefer using contains() function with the class attribute in XPath expressions.
06
Avoid using contains() with the text() function.
07
Ensure each XPath expression matches exactly one element.
08
Do not create fake or invalid XPath expressions.
09
Validate that each XPath expression works as intended.
10
Do not provide explanations, only output the results table.

Prompt library

Use these prompts directly inside ChatGPT.

Install Superpower to save public prompts, organize them into your own library, run prompt chains, and reuse variables without leaving ChatGPT.