SELECT title FROM products WHERE category = 'your_category';
import requests
from bs4 import BeautifulSoup
def fetch_product_titles(url):
response = requests.get(url)
soup = BeautifulSoup(response.text, 'html.parser')
titles = soup.find_all('h2', {'class': 'product-title'})
return [title.text for title in titles]
# Usage
product_titles = fetch_product_titles('https://example.com/products')
fetch('https://api.example.com/products?category=your_category')
.then(response => response.json())
.then(data => {
const titles = data.map(product => product.title);
console.log(titles);
})
.catch(error => console.error(error));