@repo_science · Post #4071 · 19.03.2024 г., 15:19
#webScraping#Python 🕷 Web Scraping with Python: Data Extraction from the Modern Web, 3rd Edition ✏️Ryan Mitchell ----- Main channel: @repo_science Coupons: @freecoupons_reposcience -----
Hashtags
TGINSIGHT SIMILAR POSTS
Изворен канал @pythonotes · Post #22 · 19 јан.
Заметка начинающим, которые часто сталкиваются с подобной непоняткой. Ситуация следующая, есть список файлов: names = [ 'image.bmp', 'second.txt.bkp', 'data.db', '.config.cfg', 'file.ext.bkp' ] И мы хотим убрать у них окончание ".bkp". Не знаю зачем, пример довольно надуманный) Но суть он показывает, а это главное. Те, кто еще не очень знаком с библиотекой os.path или pathlib, вероятно решат обработать имена как строки. И тут вполне подойдет метод строки strip(). Что делает этот метод? Он отрезает указанные символы по обеим сторонам строки. Если ничего не указать, то убирает невидимые символы (пробелы, табуляции и переносы строк). В нашем случае будет выглядеть вот так: >>> name.strip('.bkp') То есть просим удалить строку '.bkp' по краям имени файла, если таковая есть. Можно применить аналогичный метод rstrip(), чтобы отрезать только справа, но для этого примера используем обычный. >>> for name in names: >>> print(name.strip('.bkp')) image.bm second.txt data.d config.cfg file.ext Хм, что-то не то с нашими именами! Что случилось??? Видим нежелательное переименование в именах, где и близко не было указанной строки '.bkp' А дело всё в том, что данный метод ищет не указанную строку, а указанные символы, и не важно в каком порядке. Для метода strip() строка '.bkp' это не паттерн для поискаа список символов. Потому он отрезал симовол 'p' от '.bmp' и удалил точку из файла '.config.cfg'. Как тогда правильно заменить именно паттерн? Для начинающего можно посоветовать метод строки replace(), который как раз использует для замены указанную строку целиком. В нашем примере заменим её на пустую строку. >>> for name in names: >>> print(name.replace('.bkp', '')) image.bmp second.txt data.db .config.cfg file.ext Уже лучше, но помните, это лишь пример про strip(). Для работы с именами файлов есть способы и более "правильные", дающие однозначно верный результат. Я взял файлы только в качестве примера. Даже replase() тут может сделать не то что ожидаем. Просто впредь будьте внимательны с этим strip(). #basic
Hashtags
Пребарај: #webscraping
@repo_science · Post #4071 · 19.03.2024 г., 15:19
#webScraping#Python 🕷 Web Scraping with Python: Data Extraction from the Modern Web, 3rd Edition ✏️Ryan Mitchell ----- Main channel: @repo_science Coupons: @freecoupons_reposcience -----
Hashtags
@repo_science · Post #3543 · 29.08.2023 г., 02:03
#Python#webscraping 😎 Automate the Boring Stuff with Python Programming Automate the Boring Stuff with Python was written for people who want to get up to speed writing small programs that do practical tasks as soon as possible. You don’t need to know sorting algorithms or object-oriented programming, so this course skips all the computer science and concentrates on writing code that gets stuff done. - Web scraping - Parsing PDFs and Excel spreadsheets - Automating the keyboard and mouse - Sending emails and texts - And several other practical topics ⚖️10.5 GB 🔗Link ----- Main channel:@repo_science Coupons: @freecoupons_reposcience -----
Hashtags
@repo_science · Post #3215 · 22.05.2023 г., 15:31
#python#webScraping 🐍 Scrapy masterclass: Python web scraping and data pipelines Work on 7 real-world web-scraping projects using Scrapy, Splash, and Selenium. Build data pipelines locally and on AWS 🔗Link ----- Main channel: @repo_science Coupons: @freecoupons_reposcience -----
Hashtags
@repo_science · Post #3207 · 21.05.2023 г., 02:35
#python#webScraping 🐍 Curso de Python desde ceroorientado a web Scraping 📢#youtube ----- Main channel: @repo_science Coupons: @freecoupons_reposcience -----
Hashtags
@repo_science · Post #3217 · 23.05.2023 г., 15:49
#webScraping El #UserAgent, o Agente de Usuario en español, es una cadena de texto que identifica el navegador web o la aplicación que se utiliza para acceder a un sitio web. Esta cadena se envía al servidor web en cada solicitud y puede contener información sobre el sistema operativo, el navegador web, la versión del navegador y los complementos utilizados. La información obtenida también puede utilizarse para optimizar la experiencia del usuario, por ejemplo, sirviendo contenido diseñado para funcionar mejor en un dispositivo móvil en lugar de una computadora portátil. Por otro lado, los webmasters pueden usar la información del user agent para verificar el reconocimiento de bots, para bloquear bots no deseados, o para algo como un análisis cruzado de usuarios o un análisis de la audiencia del sitio web. A continuación les dejamos una listado extenso de users-agents👇 🔗Lista de users-agents ----- Main channel: @repo_science Coupons: @freecoupons_reposcience -----
Hashtags
@repo_science · Post #3180 · 12.05.2023 г., 19:53
#webScraping#Python#Scrapy 🐍 Scrapy course - Python web scraping for beginners The Scrapy #Beginners Course will teach you everything you need to learn to start scraping websites at scale using #Python Scrapy. Topics - Creating your first #Scrapy spider - #Crawling through websites & scraping data from each page - Cleaning data with Items & Item Pipelines - Saving data to CSV files, #MySQL & #Postgres#databases - Using fake #user-agents & headers to avoid getting blocked - Using #proxies to scale up your web scraping without getting banned - Deploying your #scraper to the cloud & scheduling it to run periodically 🗣️ Joe Kearney. 🔗Link 📢#youtube ⭐️ Resources ⭐️ Course Resources - Scrapy Docs - Course Guide - Course Github - The Python Scrapy Playbook ----- Main channel: @repo_science Coupons: @freecoupons_reposcience -----
@githubtrending · Post #15520 · 24.02.2026 г., 14:30
#python#ai#ai_scraping#automation#crawler#crawling#crawling_python#data#data_extraction#mcp#mcp_server#playwright#python#scraping#selectors#stealth#web_scraper#web_scraping#web_scraping_python#webscraping#xpath Scrapling is a fast Python web scraping tool that fetches pages, bypasses anti-bot blocks like Cloudflare, and adapts to site changes by auto-finding elements. Use simple CSS/XPath selectors, spiders for big crawls with pause/resume, proxy rotation, and CLI—no code needed sometimes. Install via pip; it's memory-light and beats others in speed. You save time fixing broken scrapers, scrape reliably at scale, cut costs with AI tools, and focus on using data for leads, prices, or research. https://github.com/D4Vinci/Scrapling