Comments (3)
not sure how to help, more info needed
from opengpts.
import pandas as pd
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.chrome.service import Service
from webdriver_manager.chrome import ChromeDriverManager
import time
Initialize Chrome WebDriver
options = Options()
options.add_argument('--ignore-ssl-errors=yes')
options.add_argument('--ignore-certificate-errors')
options.headless = True # Modify as needed
driver = webdriver.Chrome(service=Service(ChromeDriverManager().install()), options=options)
Navigate to DHgate homepage
driver.get("https://www.dhgate.com")
Wait for the page to load
time.sleep(10)
Find the search box and search for 'shoes'
search_box = driver.find_element(By.NAME, "searchkey")
search_box.send_keys("shoes")
search_box.send_keys(Keys.RETURN)
time.sleep(10) # Wait for search results
Sort by 24-hour sales ranking, if possible
Scrape the top 500 product links
links = []
product_links = driver.find_elements(By.CSS_SELECTOR, "a.product-link") # Adjust selector as needed
for link in product_links[:500]:
links.append(link.get_attribute('href'))
Close the WebDriver
driver.quit()
Save the links in a DataFrame and then to a CSV file
df = pd.DataFrame(links, columns=["Product Link"])
df.to_csv("top_500_shoes_links.csv", index=False)
print("Top 500 product links for shoes saved to 'top_500_shoes_links.csv'")
脚本如上 基于谷歌游览器 想要获取的是shoes的类目的24小时的销量排行
from opengpts.
最直接点能不能让gtp可以访问外部网站 或者能基于gtp4上运行代码以便方便修改呢
from opengpts.
Related Issues (20)
- PostgreSQL Configuration in Docker via .env Not Applied HOT 2
- DDGS Ratelimit HOT 4
- Seems like a docker image from a different repo has been pushed as the open-gpts latest HOT 1
- StateGraph support
- Rate Limit error duckduckgo tool HOT 1
- RAG/retriever tool not working for both RAG and assistant HOT 4
- created bots and chat histories are not persisent HOT 3
- feature request - "plugin" architecture
- Prevent non authorative upsert_assistant
- Enable versioning of API paths
- Add "Capabilities" endpoint/API HOT 2
- Add Ollama as a LLM option HOT 1
- bug - no saved bot edit button with long names
- Editing Assistant: changing agent type overwrites other changes HOT 1
- Editing/viewing a bot: retrieval and files not visible or editable
- Question regarding roadmaps and upcoming features
- Env Variables | Must provide one of the 'base_url' or 'azure_endpoint' arguments HOT 1
- Assistant doesn't seem to have the ability to run Python code HOT 1
- Delete an assistant
- fix error please HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from opengpts.