Click here to Skip to main content
16,021,226 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
Hi Team

I want to find out how to use data frame that will show a number of url links? Second question how then will i use google_trans to translate the text from the website url is English links into Hindi?

What I have tried:

from selenium import webdriver
from selenium.webdriver.common.by import By
import time

url = "https://www.classcentral.com/collection/top-free-online-courses"
driver = webdriver.Chrome()
driver.get(url)
time.sleep(1)

all_courses = driver.find_element(by=By.CLASS_NAME, value='catalog-grid__results')
course_titles = all_courses .find_elements(by=By.CSS_SELECTOR, value='[class="color-charcoal course-name"]')

for title in course_titles:
    print(title.text)
Posted
Updated 2-Mar-23 2:42am
Comments
[no name] 2-Mar-23 7:11am    
"how to use data frame that will show a number of url links?"
What data frame are you referring to?

"how then will i use google_trans to translate"
See the Google documentation for their translate API.
Andre Oosthuizen 2-Mar-23 10:03am    
The translate to Hindi was answered a few days ago, answer accepted - How to scrap multiple webpages by translating each english page to hindi using Python[^]. Why ask the same question again?

1 solution

You can read up on the Google Translate API here[^].
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900