# Search Plugin for Anandtech using its own search engine

**URL:** <https://discourse.devontechnologies.com/t/search-plugin-for-anandtech-using-its-own-search-engine/23679>\
**Category:** Automation\
**Created:** [March 13, 2018, 2:43pm UTC](https://discourse.devontechnologies.com/t/search-plugin-for-anandtech-using-its-own-search-engine/23679 "2018-03-13T14:43:03Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ondiversion](https://discourse.devontechnologies.com/user_avatar/discourse.devontechnologies.com/ondiversion/32/5865_2.png) [@ondiversion](https://discourse.devontechnologies.com/u/ondiversion)\
**Post date:** [March 13, 2018, 2:43pm UTC](https://discourse.devontechnologies.com/t/search-plugin-for-anandtech-using-its-own-search-engine/23679/1 "2018-03-13T14:43:03Z")

</div>

Unfortunately, I have zero knowledge on both xml and json.  
I tried to figure it out by myself for couple of days, but I could not find any solution.

When I try to search with keyword “samsung” from Anandtech website’s search engine,  
I get the url below:

[https://www.anandtech.com/SearchResults?q=samsung](https://www.anandtech.com/SearchResults?q=samsung)

In addition, if I click on the next page icon of the search results,  
I get the url below:

[https://www.anandtech.com/SearchResults?CurrentPage=2&q=samsung&sort=date](https://www.anandtech.com/SearchResults?CurrentPage=2&q=samsung&sort=date)

I think I have to combine two urls in one plugin to get sufficient result on devonagent, but I have no clue how to combine them. (I tried to copy other plugins to use it as a scratchpad, but the provided urls were quite different, so I couldn’t successfully exploit this approach…)  
When I use only one of the url form above in the devonagent’s plugin creator, I can only get partial results. (partial results means, around 20 final search results, while I get 34 page of results if I use website’s built in search engine.)

Please help me to find solution on this matter.  
I would really like to build a ground knowledge from this case to work on other websites by myself.

---

<div class="post-metadata">

**Author:** ![cgrunenberg](https://discourse.devontechnologies.com/user_avatar/discourse.devontechnologies.com/cgrunenberg/32/7172_2.png) [@cgrunenberg](https://discourse.devontechnologies.com/u/cgrunenberg)\
**Post date:** [March 13, 2018, 2:54pm UTC](https://discourse.devontechnologies.com/t/search-plugin-for-anandtech-using-its-own-search-engine/23679/2 "2018-03-13T14:54:52Z")

</div>

There are two options:

1. Create a new search set, add the URL [anandtech.com/show/](https://www.anandtech.com/show/) to the “Sites” tab and change the mode from “Crawl” to “Search”

2. Choose File \> New Plugin, paste the following URL…

```auto

https://www.anandtech.com/SearchResults?CurrentPage=_agentOffset_&q=_agentQuery_&sort=date

```

…and then add this to the plugin’s code to get only the desired links:

```auto

	<key>LinksMatching</key>
	<string>*www.anandtech.com/show/*</string>

```

---

<div class="post-metadata">

**Author:** ![ondiversion](https://discourse.devontechnologies.com/user_avatar/discourse.devontechnologies.com/ondiversion/32/5865_2.png) [@ondiversion](https://discourse.devontechnologies.com/u/ondiversion)\
**Post date:** [March 13, 2018, 3:31pm UTC](https://discourse.devontechnologies.com/t/search-plugin-for-anandtech-using-its-own-search-engine/23679/3 "2018-03-13T15:31:09Z")

</div>

Thank you for your quick answer!  
It helped me a lot to understand how it works.

However, I am wondering why my search using this plugin stops on page 4, every time.  
I have modified my plugin to tackle this problem, but it didn’t work.  
Now my plugin looks like this:

```auto

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
	<key>Description</key>
	<string>Searches the web using &lt;www.anandtech.com&gt;.</string>
	<key>EngineUrl</key>
	<string>https://www.anandtech.com/SearchResults?CurrentPage=_agentOffset_&amp;q=_agentQuery_&amp;sort=date</string>
	<key>Identifier</key>
	<string>www.anandtech.com</string>
	<key>Info</key>
	<string>Anandtech Plugin</string>
	<key>LinksMatching</key>
	<string>*www.anandtech.com/show/*</string>
	<key>Name</key>
	<string>Anandtech</string>
	<key>OffsetPerPage</key>
	<integer>1</integer>
	<key>Operators</key>
	<integer>59</integer>
	<key>ParseLinks</key>
	<true/>
	<key>ResultsPerPage</key>
	<integer>15</integer>
	<key>Start</key>
	<integer>1</integer>
	<key>Version</key>
	<string>1.0</string>
</dict>
</plist>

```

Log pane from search result window says searching stops on page 4.  
As I mentioned earlier, the result page should be 34 (and each page contains 15 result except for 34th page.)  
I am wondering what am I missing…

---

<div class="post-metadata">

**Author:** ![cgrunenberg](https://discourse.devontechnologies.com/user_avatar/discourse.devontechnologies.com/cgrunenberg/32/7172_2.png) [@cgrunenberg](https://discourse.devontechnologies.com/u/cgrunenberg)\
**Post date:** [March 13, 2018, 3:38pm UTC](https://discourse.devontechnologies.com/t/search-plugin-for-anandtech-using-its-own-search-engine/23679/4 "2018-03-13T15:38:52Z")

</div>

By default only up to 100 results are used. You can customize this by creating a search set, enabling your plugin and changing the number of results per plugin.
