mirror of
https://github.com/SillyTavern/Extension-WebSearch.git
synced 2026-10-15 13:31:52 +00:00
[GH-ISSUE #10] [Bug] Can't visit more than ten Websites with DuckDuckGo #5
Labels
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
SillyTavern/Extension-WebSearch#5
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @NXTler on GitHub (Feb 20, 2025).
Original GitHub issue: https://github.com/SillyTavern/Extension-WebSearch/issues/10
Greetings,
I discovered that you can't visit more than ten websites when using DuckDuckGo as your search engine. I suspect that this is due to DuckDuckGo not loading more than ten links when not specifically clicking the "show more results" button.
@NXTler commented on GitHub (Mar 7, 2025):
Tinkered a bit with the WebSearch Selenium code and could confirm that this is due to DuckDuckGo only giving 10 results initially.
I was able to work around this issue by enabling autoloading in the link parameters and then scroll to the bottom with some waiting time.
Here is how the modified link looks now:
https://duckduckgo.com/?kl=wt-wt&kp=-2&kav=1&kf=-1&kac=-1&k1=-1&kv=n&q=kav=-1enables Auto-load Resultskf=-1turns off Favicons, resulting in faster loading speedkac=-1turns off Auto-suggestions, they are not needed so why not disable themk1=-1disables Advertisements, probably helps with getting higher quality resultskv=-1disables page numbers, also not neededHere is the scrolling and waiting code I inserted after
await driver.wait(until.elementLocated(By.id('web_content_wrapper')), config.TIMEOUT);:This is just a quick and dirty fix to the issue, we probably need to introduce a max links parameter and repeatedly scroll until the desired amount is reached. Though, we would need to adjust how a timeout is detected.
@Cohee1207 commented on GitHub (Mar 7, 2025):
Good suggestions about those. I think I could add those even without the scrolling hack.
Additional features I can suggest too:
kbh=-1disable page titles (unused)ko=-1disable page header (faster load)@NXTler commented on GitHub (Mar 7, 2025):
Are instant answers used? Else we could turn off headers completely with -2.
@NXTler commented on GitHub (Mar 7, 2025):
Where did you find the kbh parameter, haven't seen it documented anywhere?
We might be able to disable some more stuff, as I don't feel like spamming DuckDuckGo with useless requests.
@Cohee1207 commented on GitHub (Mar 7, 2025):
You can set it via DDG preferences page.
@NXTler commented on GitHub (Mar 8, 2025):
Found a few that might be interesting:
kz=-1disables the quick answer boxeskat=-1turns off location specific resultsksn=5increases the text snipped size to 5 lineskbg=-1hides the AI chat Iconkbe=0turns off AI answerskpsb=-1hides the always private reminder@NXTler commented on GitHub (Mar 11, 2025):
Here is what I came up with for now:
I'm no developer, so I don't know if this is a good/proper approach.
30is just a placeholder right now and should be replaced with the visit count set by the extension, however I have no clue how to do that.This is the link I'm currently using for testing, and it seems very fast:
https://duckduckgo.com/?kl=wt-wt&kp=-2&kav=1&kf=-1&kac=-1&kbh=-1&ko=-1&k1=-1&kv=n&kz=-1&kat=-1&kbg=-1&kbe=0&kpsb=-1&q=@Cohee1207 commented on GitHub (Mar 11, 2025):
We're still talking about the plugin, but the real limit is here:
https://github.com/SillyTavern/Extension-WebSearch/blob/main/settings.html#L172
@NXTler commented on GitHub (Mar 11, 2025):
I already saw that, but it seemed to work fine when I entered 30 in the settings.
I mean, the plugin also needs to know how much it should load, that's why I did it like this.
@NXTler commented on GitHub (Mar 12, 2025):
Worked a bit more on it, the visit count isn't limited anymore and directly controls how many links the previous code aims for. The whole thing seems fully functional. Is it okay when I do the PRs only fixing this for DuckDuckGo?
@Cohee1207 commented on GitHub (Mar 12, 2025):
Technically this was and still is a provider limitation. You can uncap the limit on the UI, but all the other providers except DDG via a plugin would not benefit from that.
@NXTler commented on GitHub (Mar 13, 2025):
Yeah, that's why I'm asking if that would be fine to do. The only potential solution I could find for Google, is by making use of the
&num=and/or the&start=link parameters.&num=Determines the number of links per page up to 100&start=Can be used to start the search at a different page.Google search isn't working for me, as it instantly detects that a bot is doing the search. So someone else would need to implement this.
@NXTler commented on GitHub (Mar 13, 2025):
Miss clicked as completed. My bad.
@NXTler commented on GitHub (Mar 13, 2025):
We could set the limit to 100 and just insert the variable into the Google link with
&num=.