Skip to main content

Explore Web Pages - Scrapers and Crawlers

Project description

WebXplore (v1.0.3)

Build Status PyPI - License codecov PyPI - Python Version

WebXplore offers multitude of tools for web scraping, crawling and performing computations on scraped information to determine sentiment values or tone of the author.

This package helps in retrieving information from these sources:

  1. Google Search: Get links from any google search query.

  2. Website Text: Use an intelligent parser to strip all the HTML pages from webpage contents.

  3. Twitter: Given a word or phrase, get related tweets.

  4. Reddit: Get the hottest posts given the subreddit and a key phrase.

  5. NewsAPI: Retrieve News Articles given topic or phrase.

Installation

$ pip install webxplore

or clone the repository.

$ git clone https://github.com/arnavn101/WebXplore.git

Getting Started

Here are steps for using webxplore.

1. Get Links from Google Search

from webxplore import WebSearcher

searchQuery = WebSearcher.SearchWeb('Artificial Intelligence', 5)
print(searchQuery.returnListLinks())

2. Scrape a Website

from webxplore import WebScraper

webScraper = WebScraper.ScrapeWebsite('https://en.wikipedia.org/wiki/Artificial_intelligence')
print(webScraper.return_article())

3. Get Sentiments from Text

from webxplore.utils import SentimentAnalyzer

sentimentAnalyzer = SentimentAnalyzer.RetrieveSentiments('This is a good situation.')
print(sentimentAnalyzer.returnFinalSentiment())

4. Get Summary of the Text

from webxplore.utils import TextSummarizer

textSummarizer = TextSummarizer.SummarizeText('He feels very scared. He wants to protect himself.', 1)
print(textSummarizer.returnFinalSummary())

5. Get Tone of the Text (for each sentence)

from webxplore.utils import ToneAnalyzer

textTone = ToneAnalyzer.ToneAnalysis('Laugh and the world laughs with you.' +
                                     'Weep and you weep alone.', "watsonApiKey")
print(textTone.returnTone())

6. Use the news api to get the latest articles

from webxplore.searchBeyond import SearchNews

newsArticles = SearchNews.RetrieveNewsArticle('Politics', 5, 'newsApiKey')
print(newsArticles.return_articleSentences())

7. Get Posts from a SubReddit

from webxplore.searchBeyond import SearchReddit

redditPosts = SearchReddit.CrawlSubReddit('stocks', 'amazon', 10, 'RedditClientId',
                                          'RedditClientSecret', 'RedditUserAgent')
print(redditPosts.return_listSentences())

8. Get Tweets that have a key word

from webxplore.searchBeyond import SearchTwitter

retrieveTweets = SearchTwitter.CrawlTwitter('tesla', 10, 'TwitterConsumerKey', 'TwitterConsumerSecret',
                                            'TwitterAccountKey', 'TwitterAccountSecret')
print(retrieveTweets.return_tweets())

Contributions

Anyone is welcome to add any contribution to this repository. All good changes are welcome. Please create a pull request and ensure that it passes all the CI tests.

License

MIT License Copyright (c) 2020, Arnav Nidumolu

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

WebXplore-1.0.3.tar.gz (9.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

WebXplore-1.0.3-py3-none-any.whl (14.7 kB view details)

Uploaded Python 3

File details

Details for the file WebXplore-1.0.3.tar.gz.

File metadata

  • Download URL: WebXplore-1.0.3.tar.gz
  • Upload date:
  • Size: 9.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.1.post20200807 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.7.0

File hashes

Hashes for WebXplore-1.0.3.tar.gz
Algorithm Hash digest
SHA256 86a02a5a54acc47f629761b76cd0461ee7eb9170f28d53562b6e808cab92fbc2
MD5 6d92ea45e755295aa036d244c67ccd82
BLAKE2b-256 3e80b09ea82be0aa4b327413520b219f373e196cad0e13e66ee0e7f99766c9d4

See more details on using hashes here.

File details

Details for the file WebXplore-1.0.3-py3-none-any.whl.

File metadata

  • Download URL: WebXplore-1.0.3-py3-none-any.whl
  • Upload date:
  • Size: 14.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.1.post20200807 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.7.0

File hashes

Hashes for WebXplore-1.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 0a4aa32118babd916a396d60fc7505742f6b54c0372bf3be421f24026eff490a
MD5 9602d0c1b8988b495f5575333b8e6cf5
BLAKE2b-256 4a81ef4e0bf51b2b01da3f2165003aa569c9843fc9a20a71a92733c7a8471293

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page