<jupyter_start><jupyter_text>NASA Mars News<jupyter_code># Scrape the NASA Mars News Site and collect the latest News Title and Paragragh Text. 
# Assign the text to variables that you can reference later.
html = browser.html
soup = bs(html, 'html.parser')

news_title = soup.find('div', class_='content_title')
news_p = soup.find('div', class_='article_teaser_body')
print(news_title.text)
print(news_p.text)<jupyter_output>Opportunity Hunkers Down During Dust Storm
Science operations for NASA's Opportunity rover have been temporarily suspended as it waits out a growing dust storm on Mars.<jupyter_text>JPL Mars Space Images - Featured Image<jupyter_code># Use splinter to navigate the site and find the image url for the current Featured Mars Image and assign the url string to a 
# variable called featured_image_url.
# executable_path = {'executable_path': 'chromedriver.exe'}
# browser = Browser('chrome', **executable_path, headless=False)
featured_image_base_url = 'https://www.jpl.nasa.gov'
featured_image_url = 'https://www.jpl.nasa.gov/spaceimages/?search=&category=Mars'
browser.visit(featured_image_url)
featured_image_html = browser.html
featured_image_soup = bs(featured_image_html, 'html.parser')

featured_image = featured_image_base_url + featured_image_soup.find(id='full_image')['data-fancybox-href']
featured_image<jupyter_output><empty_output><jupyter_text>Mars Weather<jupyter_code># Visit the Mars Weather twitter account here and scrape the latest Mars weather tweet from the page. 
# Save the tweet text for the weather report as a variable called mars_weather.
twitter_url = 'https://twitter.com/marswxreport?lang=en'
twitter_html = requests.get(twitter_url)
twitter_soup = bs(twitter_html.text, 'html.parser')
mars_weather = twitter_soup.find(class_='TweetTextSize--normal')
print(mars_weather.text)<jupyter_output>This storm hit us by surprise. But by chance we happened to be in about the best configuration possible to weather this storm. Another saving grace is dust storms trap heat, so it won’t get as cold at night.<jupyter_text>Mars Facts<jupyter_code>facts_url = 'https://space-facts.com/mars/'
data = pd.read_html(facts_url)
data
facts_df = data[0]
facts_df<jupyter_output><empty_output><jupyter_text>Mars Hemispheres<jupyter_code># Obtain images for each of Mars' hemispheres.
# Save both the image url string for the full resolution hemipshere image, and the Hemisphere title containing the hemisphere name. 
# Use a Python dictionary to store the data using the keys img_url and title.
img_base_url = 'https://astrogeology.usgs.gov'
img_url = 'https://astrogeology.usgs.gov/search/results?q=hemisphere+enhanced&k1=target&v1=Mars'
browser.visit(img_url)
img_html = browser.html
img_soup = bs(img_html, 'html.parser')

# Create a list to store results

hemispheres = img_soup.select('div.item')
mars_hemispheres = []


for hemisphere in hemispheres:
    title = (hemisphere.find('h3').text).replace(' Enhanced', '')
        
    #click the hemisphere
    browser.click_link_by_partial_text(title)
    
    #make new soup of that page
    soup = bs(browser.html, 'html.parser')
    
    #find the full image
    full = soup.find('a', text='Sample')
    
    #get the img url
    img_url = full['href']
    
    #make a dict and append to the list
    mars_hemispheres.append({'title': title, 'img_url': img_url})
    
    #go back 
    browser.back()

#close browser
browser.quit()    

mars_hemispheres<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.09761013532968615, 'fraction_numerical': 0.001151742009789807, 'mean_word_length': 5.397790055248619, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 19, 'https://': 6, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '5', 'dir': 'jupyter-structured-clean-dedup', 'id': '595151', 'license': 'ADSL', 'n_tokens_mistral': 1176, 'n_tokens_neox': 1118, 'n_words': 319, 'path': 'mission_to_mars.ipynb', 'repo_name': 'kelbar13/13-Mission-to-Mars', 'size': '3473'}