<jupyter_start><jupyter_text>Mars Weather Twitter Section Below<jupyter_code>#now to process the Mars weather:
weather_url = 'https://twitter.com/marswxreport?lang=en'
browser.visit(weather_url)
html_weather = browser.html
soup_weather = BeautifulSoup(html_weather, 'html.parser')
weather_p = soup_weather.find_all('p', class_="TweetTextSize TweetTextSize--normal js-tweet-text tweet-text")
mars_weather = weather_p[0].text
print(mars_weather)<jupyter_output>Sol 2224 (2018-11-08), high 0C/32F, low -72C/-97F, pressure at 8.65 hPa, daylight 06:19-18:36<jupyter_text>Mars facts section below (get the table)<jupyter_code>facts_url = 'http://space-facts.com/mars'
mars_table = pd.read_html(facts_url, flavor = 'html5lib')
mars_table
mars_df = mars_table[0]
mars_df.columns = ['Description', 'Value']
mars_df
mars_html = mars_df.to_html(index=False)
mars_html<jupyter_output><empty_output><jupyter_text>Mars Hemispheres section below<jupyter_code>hemisphere_url = 'https://astrogeology.usgs.gov/search/results?q=hemisphere+enhanced&k1=target&v1=Mars'
browser.visit(hemisphere_url)
html_hemis = browser.html
soup_hemis = BeautifulSoup(html_hemis, 'html.parser')
hemis_links = soup_hemis.find_all('a', class_="itemLink product-item")
print(hemis_links)
#hemisphere = {}
#test_output = browser.find_by_css('a.product-item')[1].click()
#testagain = browser.find_link_by_text('Sample').first
#print(testagain)
#hemisphere['img_url'] = testagain['href']
#hemisphere
#hemisphere['title'] = browser.find_by_css('h2.title').text
#hemisphere
#test_output2 = browser.find_by_css('a.itemLink')[3].click()
links = browser.find_by_css("a.product-item")
number = len(links)
number
hemisphere_image_urls = []
for i in range (number):
    hemisphere = {}
    i = i + 1
    
    print(i)
    try:
        browser.find_by_css('a.product-item')[i].click()
        
    except:
        continue
    
    hemi_href = browser.find_link_by_text('Sample').first
    hemisphere['img_url'] = hemi_href['href']
    hemisphere['title'] = browser.find_by_css('h2.title').text
    
    hemisphere_image_urls.append(hemisphere)
    print(i)
    browser.back()
hemisphere_image_urls<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.13970588235294118, 'fraction_numerical': 0.01884191176470588, 'mean_word_length': 6.184818481848184, 'pattern_counts': {'":': 0, '<': 12, '<?xml version=': 0, '>': 12, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, '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': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '151017', 'license': 'ADSL', 'n_tokens_mistral': 861, 'n_tokens_neox': 821, 'n_words': 119, 'path': 'mission_to_mars.ipynb', 'repo_name': 'Plybuf/Homework10-WebScraping', 'size': '2176'}