Skip to main content

A python library to pull information on Profile and MatchHistory from op.gg (last verified 06/05/2020).

Note: scrapes using English, only tested on NA server at the moment.

Requirements

  • from selenium import webdriver

  • from selenium.webdriver.common.by import By

  • from selenium.webdriver.support import expected_conditions as EC

  • from selenium.webdriver.support.wait import WebDriverWait

  • import re

  • import os

  • from bs4 import BeautifulSoup

Installation

pip install scrapeGG==0.0.4

or

git clone https://github.com/emily-yu/animelyrics.git
cd animelyrics
python setup.py

Usage

set up chromedriver, if not already exists check if already exists using chromedriver --version

install chromedriver brew cask install chromedriver

find path which chromedriver

import and create an instance, such that ‘API’ is the summonerName you want to search for.

scrapeGG(string summonerName)

from scrapeGG import scrapeGG
init = scrapeGG('API')

Functions

(see scrape_test.py for usage examples) (see snapshots/06-06-2020.json for example output)

scrapeGG.profile

  • .getProfile() - [CONSTRUCTOR] - returns profile()

  • .recently_played_with()

  • .top_played_champions() - todo

  • .rank(string game_type= [“Ranked Solo”, “Total”, “Ranked Flex 5v5”) - todo

scrapeGG.match

  • .getMatch(int count) - returns match()

  • .getMatchSequence(int count) - returns arrscrapeGG.match

  • .game_player_names(is_win)

  • .self_stats()

  • .recent.player_stats(string summonerName) - summonerName can be any of the players in the game

  • .overview() - unstable*

  • .build() - unstable*

*selenium has issues with click events, which occasionally raisesselenium.common.exceptions.ElementClickInterceptedException: Message: element click intercepted

example usage

from scrapeGG import scrapeGG

init = scrapeGG('API')

# test match api class
recent = init.getMatch(1)
player_names = recent.game_player_names(True)

profile = init.getProfile()
ranksolo_rank = profile.rank('Ranked Solo')

changelog

0.0.2 - first release on PyPI

Release files for scrapeGG 0.0.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for scrapeGG 0.0.5
File Size Uploaded
scrapeGG-0.0.5.tar.gz 8.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for scrapeGG 0.0.5
File Interpreter ABI Platform
scrapeGG-0.0.5-py2.py3-none-any.whl Python 3, Python 2 none any Details

Total release size: 18.2 kB

Release files / scrapeGG-0.0.5.tar.gz

Download URL scrapeGG-0.0.5.tar.gz
Size 8.9 kB
Tags Source
SHA-256 checksum
How to use checksums
50690b31615fbf2ad1d4ed5b87cb5c4d2ad4ff2a719acd66a104e8c80b525e0a
BLAKE2b-256 checksum
How to use checksums
1665c179aeabe8d50458f0b70d84b878187ef40a9357ce2f72bba22bb0cdee9d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.7.3

Release files / scrapeGG-0.0.5-py2.py3-none-any.whl

Download URL scrapeGG-0.0.5-py2.py3-none-any.whl
Size 9.3 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
87c7a6158d7748f51b593f546e5463a7bf9bb2449802f13f557bd8f4a82bf970
BLAKE2b-256 checksum
How to use checksums
c562a9b8068bdc4b09e658dffbf6abc44bb144d7803633337fb9dbf357851ea4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.7.3

Release history Release notifications | RSS feed

This release

0.0.5 This release

2 release files

0.0.4

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page