Skip to main content

A package to solve LinkedIn games by extracting solutions

Project description

LinkedIn Games Scraper

A Python package that automatically solves LinkedIn games by extracting solutions from network requests.

Features

  • Solves all LinkedIn daily games:
    • Pinpoint
    • CrossClimb
    • Queens
    • Zip
    • Tango
    • Mini Sudoku
  • Headless operation (no browser window required)
  • Saves solutions to JSON files
  • Simple API for integration into other projects

Installation

pip install linkedin_games_scraper

Requirements

  • Python 3.6+
  • Chrome browser installed
  • ChromeDriver compatible with your Chrome version

Usage

Command Line

After installation, you can run the scraper from the command line:

linkedin-games-solver

This will solve all LinkedIn games and save the results to a JSON file in the results directory.

Python API

Solving All Games

from linkedin_games_scraper import GameSolver

# Create a solver instance
solver = GameSolver(headless=True)

# Solve all games
results = solver.solve_all_games()

# Results will contain solutions for all games
print(results)

Solving a Specific Game

from linkedin_games_scraper import GameSolver

# Create a solver instance
solver = GameSolver(headless=True)

try:
    # Solve Pinpoint
    pinpoint_solution = solver.solve_pinpoint()
    print(f"Pinpoint solution: {pinpoint_solution}")

    # Solve CrossClimb
    crossclimb_solution = solver.solve_crossclimb()
    print(f"CrossClimb solution: {crossclimb_solution}")

    # Other games: solve_zip(), solve_queens(), solve_tango(), solve_mini_sudoku()
finally:
    # Always clean up to close the browser and save results
    results_file = solver.cleanup()
    print(f"Results saved to {results_file}")

Customising the Results Directory

from linkedin_games_scraper import GameSolver

# Specify a custom results directory
solver = GameSolver(headless=True, results_dir="my_solutions")

# Solve games...
solver.solve_all_games()

Timeouts and Logging

All game solvers use a per-game timeout of 30 seconds by default and produce detailed logs while navigating, switching iframes, clicking the start button, scanning network requests, and extracting solutions.

You can override the timeout per solver method if needed, for example:

from linkedin_games_scraper import GameSolver

solver = GameSolver(headless=True)

# Increase timeout for Zip to 60 seconds
zip_solution = solver.solve_zip(timeout_seconds=60)

How It Works

The package uses Selenium with the selenium-wire extension to:

  1. Navigate to the LinkedIn game page
  2. Wait for the game to load
  3. Click the start button
  4. Intercept network requests containing game solutions
  5. Extract and format the solution data
  6. Save the results to a JSON file

Development

Setup Development Environment

# Clone the repository
git clone https://github.com/sebtheo/linkedin-games-scraper.git
cd linkedin-games-scraper

# Install development dependencies
pip install -e ".[dev]"

# Install pre-commit hooks
pre-commit install

Using the Makefile

The project includes a Makefile with common development tasks:

# Install development dependencies
make dev-install

# Run linting
make lint

# Format code
make format

# Run tests
make test

# Build package
make build

# Clean build artifacts
make clean

# Run the package
make run

Local Testing

To run the package locally without installing:

# Run directly
python run.py

# Or use the module
python -m linkedin_games_scraper

Troubleshooting

  • Browser crashes or fails to start: Ensure you have the latest version of Chrome and ChromeDriver installed.
  • No solutions found: LinkedIn may have changed their API. Please check for updates to this package.
  • Slow performance: Try setting headless=False to see what's happening in the browser.

Licence

This project is licensed under the GNU Affero General Public License v3.0 - see the LICENSE file for details.

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

linkedin_games_scraper-0.2.0.tar.gz (22.0 kB view details)

Uploaded Source

Built Distribution

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

linkedin_games_scraper-0.2.0-py3-none-any.whl (21.4 kB view details)

Uploaded Python 3

File details

Details for the file linkedin_games_scraper-0.2.0.tar.gz.

File metadata

  • Download URL: linkedin_games_scraper-0.2.0.tar.gz
  • Upload date:
  • Size: 22.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.6

File hashes

Hashes for linkedin_games_scraper-0.2.0.tar.gz
Algorithm Hash digest
SHA256 e7bd7927ce9dec813aafa78726eef8a2bcb0aebeeeaea8042e9a9b2503ea4d12
MD5 5e754dce3498f47b811ca91f02042a0e
BLAKE2b-256 8bcb378187823ce445de9577100b5ee7d3390195d867dd11fd5fa1987d58abb4

See more details on using hashes here.

File details

Details for the file linkedin_games_scraper-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for linkedin_games_scraper-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 143e1ad10f42923dd459ddafcdbfc9b216e9ab27515a059e8cbe4d2b866ac90e
MD5 8a346d297bed62e10036eb7933be2107
BLAKE2b-256 fbd988c5575c4f229eabff127776fcf2c768203dfe771fc9a1ac116e4462e266

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