Coding

Generate XPath Expressions for Article Elements

Act as a Senior XPath engineer to extract the XPath expressions for the title, publish time, and content fields from an article at a specified URL. Provide the results in a table format with columns for field, XPath expression, and XPath match results (excluding content). Ensure

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 for 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.