@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 #381 · 23 окт.
Установить свойства виджета в PySide можно не только через соответствующие методы и конструктор класса. Можно их изменять с помощью метода setProperty по имени. btn = QPushButton("Click Me") btn.setProperty("flat", True) Это аналогично вызову btn.setFlat(True) Если указать несуществующее свойство, то оно просто создается btn.setProperty("btnType", "super") Получить его значение можно методом .property(name) btn_type = btn.property("btnType") Когда это может быть полезно? ▫️Можно просто хранить какие то данные в виджете и потом их доставать обратно widget = QWidget() widget.setProperty('my_data', 123) print(widget.property('my_data')) ▫️ Назначая эти свойства разным виджетам можно потом отличить виджеты во время итераци по ним. Например, найти все кнопки со свойством my_data="superbtn". Но ведь вместо кастомного свойства можно использовать objectName, будет тот же результат. Да, но y ObjectName есть ограничение - только строки. ▫️ Если нам потребуется не просто поиск а, например, сортировка по числу, то свойства позволяют нам это сделать. Поддерживается любой тип данных widget.setProperty('my_data', {'Key': 'value'}) widget.setProperty('order', 1) all_widgets.sort(key=w: w.property('order')) Но ведь Python позволяет всё вышеперечисленное сделать простым созданием атрибута у объекта widget.order = 1 widget.my_data = 123 Да, но я думаю что не надо объяснять почему не стоит так делать. К тому же, если у виджета нет свойства то метод .property(name) вернет None, а отсутствующий атрибут выбросит исключение. ▫️ Действительно полезное применение кастомным свойствам - контроль стилей. Здесь атрибутами не обойтись, нужны именно свойства. Дело в том, что в селекторах стилей можно указывать конкретные свойства виджетов на которые следует назначать стиль. Просто запустите этот код from PySide2.QtWidgets import * if __name__ == "__main__": app = QApplication([]) widget = QWidget(minimumWidth=300) layout = QVBoxLayout(widget) btn1 = QPushButton("Action 1") btn2 = QPushButton("Action 2") btn3 = QPushButton("Action 3", flat=True) layout.addWidget(btn1) layout.addWidget(btn2) layout.addWidget(btn3) # добавим кастомное свойство одной кнопке btn1.setProperty("btnType", "super") # добавляем стили widget.setStyleSheet( """ QPushButton[btnType="super"] { background-color: yellow; color: red; } QPushButton[flat="true"] { color: yellow; } """ ) widget.show() app.exec_() С помощью селектора мы избирательно назначили стили на конкретные кнопки. Как получить список всех кастомный свойств? Функция получения списка кастомных свойств отличается от получения дефолтных. def print_widget_dyn_properties(widget): for prop_name in widget.dynamicPropertyNames(): property_name = prop_name.data().decode() property_value = widget.property(property_name) print(f"{property_name}: {property_value}") #tricks#qt
Пребарај: #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