Skip to content

Instantly share code, notes, and snippets.

@AbdulmohsenA
AbdulmohsenA / scrape_arabic_books.py
Created June 26, 2024 22:15
Code to rapidly scrape Arabic books from المكتبة الشاملة
# THIS CODE IS INTENDED TO SCRAPE ARABIC BOOKS FROM https://shamela.ws
import requests
from bs4 import BeautifulSoup
import pandas as pd
from concurrent.futures import ThreadPoolExecutor
def scrape_page(book_code, page):
'''Scrape a page from a book in Shamela website: https://shamela.ws'''
url = f'https://shamela.ws/book/{book_code}/{page}'