using @href with different page variables after the ? = mark,opening all specific url links within a webpage

12 views
Skip to first unread message

Blues H.

unread,
May 24, 2024, 7:14:01 AMMay 24
to Auto Clicker - AutoFill

** using @href with different page variables after the ?  = mark,opening all specific url links within a webpage**

**Problem:**

The current [Element Finder] value, `//a[@href="/exam.php?id=45793"]`, targets a specific link with the exact URL `/exam.php?id=45793`. How can we modify it to automatically open all hyperlinks within the webpage that contain `/exam.php?id=`, including links like `/exam.php?id=1111` and `/exam.php?id=11589`?

**Solution:**

To automatically open all hyperlinks within the webpage that contain `/exam.php?id=`, you can use a more generic XPath expression to match them.
The XPath expression `//a[contains(@href, '/exam.php?id=')]` can match all `<a>` tags whose `href` attribute contains the string `/exam.php?id=`.

Therefore, you can enter this XPath expression in the [Element Finder] value:

```
//a[contains(@href, '/exam.php?id=')]
```

This will match and autofill all hyperlinks that meet the criteria.

**Note:** This expression will match all links containing the `id` parameter, such as `/exam.php?id=1111` and `/exam.php?id=11589`.
-----

If you only want to match links that start with `/exam.php?id=`, you can use a slightly modified expression:

```
//a[starts-with(@href, '/exam.php?id=')]
```

This will only match hyperlinks that start with the `/exam.php?id=` string.


---繁體中文 chinese---


使用@href打開網頁內所有特定鏈接,鏈接後方的?有不同頁面變量的設定

問題:
[Element Finder]值設定[//a[@href="/exam.php?id=45793"]可以開啟特定連結。
若要如何設定自動開啟網頁內所有包含[/exam.php?id=]的超鏈接?
例如[/exam.php?id=1111]、[/exam.php?id=11589]等

答:要自動開啟網頁內所有包含 /exam.php?id= 的超連結,您可以使用一個更通用的 XPath 表達式來匹配它們。
XPath 表達式 //a[contains(@href, '/exam.php?id=')] 可以符合所有href屬性包含 /exam.php?id= 字串的 <a> 標籤。

因此,您可以在 Element Finder 值中輸入這個 XPath 表達式:
Copy code//a[contains(@href, '/exam.php?id=')]
這將匹配並自動填入所有滿足條件的超連結。
注意,這個表達式會匹配形如 /exam.php?id=1111 和 /exam.php?id=11589 等所有包含 id 參數的連結。


如果您只想匹配以 /exam.php?id= 開頭的連結,可以使用微調後的表達式:
Copy code//a[starts-with(@href, '/exam.php?id=')]
這將只匹配以 /exam.php?id= 字串開頭的超連結。

Dhruv TechApps

unread,
Jun 8, 2024, 12:11:24 PMJun 8
to Auto Clicker - AutoFill
this looks perfect example . do you need any help on it
Reply all
Reply to author
Forward
0 new messages