Metadata-Version: 2.4
Name: serp_bot
Version: 0.3.1
Summary: Search Engine Results Page Bot
Home-page: https://github.com/supratikchatterjee16/serp_bot
Author: Supratik Chatterjee
Author-email: supratikdevm96@gmail.com
License: MIT License
        
        Copyright (c) 2023, Supratik Chatterjee
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Keywords: serp,bot,webscraping,scraping,search engine,package,python,crawler
Classifier: Programming Language :: Python :: 3
Classifier: Operating System :: OS Independent
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: requests
Requires-Dist: brotli
Dynamic: author
Dynamic: author-email
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: home-page
Dynamic: keywords
Dynamic: license
Dynamic: license-file
Dynamic: requires-dist
Dynamic: summary

# SERP Bot

This is a utility that has gives the basic use of scraping web engines. This is simple in the way it works, however, just using some common sense would allow you to make some rather advanced uses of this.

Caution : SERP bots are a legal gray zone.

This can be installed through pip.
```shell
pip install serp-bot
```

Alternatively, you could download this repository and install it with pip.
```shell
pip3 install .
```

## Using

This has 3 components that can be made use of. SERPBot, GenericSearchEngine and RequestDispatcher.

Sample usage 1(Directly using the SERPBot object only):

```python
from serp_bot import SERPBot, SearchEngines

bot = SERPBot(engine = SearchEngines.DUCKDUCKGO)
# or,
# bot = SERPBot(engine = SERPBot.get_random_engine())
# or, can be left blank the default engine is Yahoo

print(bot.run("hello world"))
```

Sample usage :
```python
from serp_bot import SERPBot, RequestDispatcher

bot = SERPBot()
dispatcher = RequestDispatcher()
engine = bot.get_random_search_engine()
print(engine)
engine.build_base_query('hello world')
print(engine.get_current_url())
dispatcher.get(engine.get_current_url()[0])
print(dispatcher.last_response.text)
with open('sample.html', 'w+') as html_file:
	html_file.write(dispatcher.last_response.text)
```

Alternatively, using the RequestDispatcher can help avoid some Web Scraping detection units.

```python
from serp_bot import RequestDispatcher

request_dispatcher = RequestDispatcher()
response = request_dispatcher.get('https://google.com/search?q=crapper+zapper')
print(response.content)
```
