Skip to content
This repository has been archived by the owner on Sep 7, 2023. It is now read-only.

Add a new engine: Baidu #3182

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Add a new engine: Baidu #3182

wants to merge 1 commit into from

Conversation

ShevonKuan
Copy link

@ShevonKuan ShevonKuan commented Mar 10, 2022

What does this PR do?

Add a new search engine https://www.baidu.com/

Why is this change important?

Baidu is a chinese search engine which is famous in China, so I think it is necessary to add it.

How to test this PR locally?

Run sudo make run
Go to /preferences
Disable all search engines with the exception of onesearch (the last one)
Make some search
Assert that it works as expected
Assert that the pagination works

Author's checklist

This search engine is OFF by default.
HTML parser from python-baidusearch

Related issues

#1622

@@ -398,7 +398,11 @@ engines:
timeout : 3.0
weight : 2
tests: *tests_infobox

- name: baidu
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- name: baidu
- name: baidu

engine : baidu
shortcut : bd
timeout : 2.0
disabled : True
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
disabled : True
disabled : True

@@ -1,5 +1,6 @@
certifi==2021.10.8
babel==2.9.1
beautifulsoup4==4.10.0
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would rahter not add a new dependency. Is there any reason why you used this lib instead of lxml like in other engines?

Example:

from lxml import html
dom = html.fromstring(resp.text)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants