Skip to main content

Translation

Python Node

Rocket Scraper offers robust translation capabilities powered by state-of-the-art language models. Seamlessly translate content from any webpage across multiple languages while maintaining context and meaning, whether it's product descriptions, articles, or user-generated content.

Key Benefits

  • High Accuracy: Get precise translations that preserve context and nuance
  • Broad Language Support: Translate between multiple languages automatically
  • Context-Aware: Maintains formatting and specialized terminology

How It Works

  1. Select Content: Choose the text elements you want to translate
  2. Set Languages: Specify source languages
  3. Process Content: Our models handle the translation
  4. Receive Results: Get translated content with original formatting

Example: Product Descriptions

Here's how to translate product descriptions to multiple languages:

from rocketscraper import RocketClient

try:
client = RocketClient('YOUR_API_KEY')

schema = {
"originalText": "string",
"translation": {
"text": "string",
"sourceLanguage": "string",
"targetLanguage": "string"
}
}

# Specify translation parameters
task_description = """
Translate product descriptions to Spanish and French while preserving:
- Technical specifications
- Brand names
- Product measurements
"""

result = client.scrape(
'https://example.com/products/electronics',
schema,
task_description=task_description
)
print(result)

except Exception as e:
print(f"Error: {e}")

Example Output

{
"originalText": "The XPS 13 Plus laptop features a 13.4-inch UHD+ (3840 x 2400) touch display, 12th Gen Intel® Core™ i7 processor, and up to 32GB of RAM.",
"translations": [
{
"text": "El portátil XPS 13 Plus cuenta con una pantalla táctil UHD+ de 13,4 pulgadas (3840 x 2400), procesador Intel® Core™ i7 de 12.ª generación y hasta 32 GB de RAM.",
"sourceLanguage": "en",
"targetLanguage": "es"
},
{
"text": "L'ordinateur portable XPS 13 Plus est doté d'un écran tactile UHD+ de 13,4 pouces (3840 x 2400), d'un processeur Intel® Core™ i7 de 12e génération et jusqu'à 32 Go de RAM.",
"sourceLanguage": "en",
"targetLanguage": "fr"
}
]
}

Best Practices

  1. Preserve Formatting: Maintain HTML tags and special formatting in translations

  2. Handle Special Terms: Create glossaries for brand names and technical terms

Common Use Cases

  • E-commerce: Translate product descriptions and reviews
  • Content Localization: Convert website content for international audiences
  • Customer Support: Translate user inquiries and responses
  • Documentation: Create multilingual technical documentation
  • Social Media: Translate posts and user engagement

By utilizing our advanced translation capabilities, you can expand your global reach and provide seamless multilingual experiences for your users across different markets and languages.

Try It Now

Test Rocket Scraper's translation features in our interactive playground.