<jupyter_start><jupyter_text>Mission to Mars  Importing all the dependencies<jupyter_code>#Dependencies

from splinter import Browser
from bs4 import BeautifulSoup
import pandas as pd
from webdriver_manager.chrome import ChromeDriverManager<jupyter_output><empty_output><jupyter_text>Splinter Setup<jupyter_code># Setup splinter
executable_path = {'executable_path': ChromeDriverManager().install()}
browser = Browser('chrome', **executable_path, headless=False)<jupyter_output>[WDM] - ====== WebDriver manager ======
[WDM] - Current google-chrome version is 88.0.4324
[WDM] - Get LATEST driver version for 88.0.4324<jupyter_text>Getting the latest news and description from https://mars.nasa.gov/news/<jupyter_code>#url
url='https://mars.nasa.gov/news/'

browser.visit(url)

html=browser.html

#convert the brouser html to a soup object and then quit the browser

new_soup=BeautifulSoup(html,'html.parser')

slide_element=new_soup.select_one("ul.item_list li.slide")


news_title=slide_element.find("div",class_="content_title").get_text()
news_paragraph=slide_element.find("div",class_="article_teaser_body").get_text()
print(news_title+" " +news_paragraph)<jupyter_output>NASA's Perseverance Mars Rover Mission Honors Navajo Language Working with the Navajo Nation, the rover team has named features on Mars with words from the Navajo language.<jupyter_text>Getting the featured image from https://data-class-jpl-space.s3.amazonaws.com/JPL_Space/index.html<jupyter_code># visit URL
url="https://data-class-jpl-space.s3.amazonaws.com/JPL_Space/index.html"

browser.visit(url)


html=browser.html

#convert the brouser html to a soup object and then quit the browser

new_soup_1=BeautifulSoup(html,'html.parser')

image=new_soup_1.find("a",class_="showimg fancybox-thumbs")

print("https://data-class-jpl-space.s3.amazonaws.com/JPL_Space/"+image['href'])<jupyter_output>https://data-class-jpl-space.s3.amazonaws.com/JPL_Space/image/featured/mars3.jpg<jupyter_text>Getting the mars facts from https://space-facts.com/mars/<jupyter_code>#mars facts

df=pd.read_html("https://space-facts.com/mars/")[0]
df.columns=["Description","Mars"]
df.set_index("Description", inplace=True)
df
#converting to html
df.to_html()<jupyter_output><empty_output><jupyter_text>getting the images from https://astrogeology.usgs.gov/search/results?q=hemisphere+enhanced&k1=target&v1=Mars<jupyter_code># visit URL
url="https://astrogeology.usgs.gov/search/results?q=hemisphere+enhanced&k1=target&v1=Mars"

browser.visit(url)

hemisphere_image_urls = []

# First get a list of all the hemisphere
links = browser.find_by_css("a.product-item h3")

for index in range(len(links)):
    hemisphere = {}
    
    browser.find_by_css("a.product-item h3")[index].click()
    
    # Next is find the sample image anchor tag and extract the href 
    sample_element = browser.links.find_by_text("Sample").first
    title = browser.find_by_css("h2.title").text
    link = sample_element["href"]
    
    hemisphere["title"] = title
    hemisphere["link"] = link
    
    hemisphere_image_urls.append(hemisphere)
    browser.back()

print(hemisphere_image_urls)<jupyter_output>[{'title': 'Cerberus Hemisphere Enhanced', 'link': 'https://astropedia.astrogeology.usgs.gov/download/Mars/Viking/cerberus_enhanced.tif/full.jpg'}, {'title': 'Schiaparelli Hemisphere Enhanced', 'link': 'https://astropedia.astrogeology.usgs.gov/download/Mars/Viking/schiaparelli_enhanced.tif/full.jpg'}, {'title': 'Syrtis Major Hemisphere Enhanced', 'link': 'https://astropedia.astrogeology.usgs.gov/download/Mars/Viking/syrtis_major_enhanced.tif/full.jpg'}, {'title': 'Valles Marineris Hemisphere Enhanced', 'link': 'https://astropedia.astrogeology.usgs.gov/download/Mars/Viking/valles_marineris_enhanced.tif/full.jpg'}]
StarcoderdataJupyterStructuredCleanDedup