<jupyter_start><jupyter_text>Nasa Mars News<jupyter_code>url = 'https://mars.nasa.gov/news/?page=0&per_page=40&order=publish_date+desc%2Ccreated_at+desc&search=&category=19%2C165%2C184%2C204&blank_scope=Latest'

executable_path = {'executable_path': '/usr/local/bin/chromedriver'}
browser = Browser('chrome', **executable_path, headless=True)
browser.visit(url)

html = browser.html
soup = BeautifulSoup(html, 'html.parser')
results = soup.find('ul',class_='item_list')

title_list = []
news_p = []

for result in results:
    title=result.a['href']
    title_list.append(title)
    paragraph = result.find('div',class_='article_teaser_body').text
    news_p.append(paragraph)

news_title = []    

for title in title_list:
    splited =title.split('/')
    to_append=splited[3]
    news_title.append(to_append)

news_title  
news_p<jupyter_output><empty_output><jupyter_text>Nasa Mars Images<jupyter_code>image_url = 'https://www.jpl.nasa.gov/spaceimages/details.php?id=PIA18811'
executable_path = {'executable_path': '/usr/local/bin/chromedriver'}
browser = Browser('chrome', **executable_path, headless=False)
browser.visit(image_url)
html_i = browser.html
soup_i = BeautifulSoup(html_i, 'html.parser')
results_i = soup_i.find_all('figure',class_='lede')


image_i_big = []
for result_i in results_i:
    big_image=result_i.a['href']
    image_i_big.append(big_image)
    
base_url = 'https://www.jpl.nasa.gov'
image_url=image_i_big[0]
featured_image_url=base_url+image_url
featured_image_url<jupyter_output><empty_output><jupyter_text>Mars Weather<jupyter_code>response_w=requests.get('https://twitter.com/marswxreport?lang=en')
soup = BeautifulSoup(response_w.text)
mars_weather_s= soup.find('p',class_='TweetTextSize TweetTextSize--normal js-tweet-text tweet-text').text
mars_weather = mars_weather_s
mars_weather<jupyter_output><empty_output><jupyter_text>Mars Facts<jupyter_code>tables =pd.read_html('https://space-facts.com/mars/')
df=tables[0]
df.columns=['Description','Value']
df.set_index(df['Description'],inplace=True)
del df['Description']<jupyter_output><empty_output><jupyter_text>Mars Hemispheres<jupyter_code>list_of_url = ['cerberus_enhanced','schiaparelli_enhanced','syrtis_major_enhanced','valles_marineris_enhanced']
url_final = [f'https://astrogeology.usgs.gov/search/map/Mars/Viking/{element}' for element in list_of_url]
mars_hemisphere = []
for idx,element in enumerate(url_final):
    executable_path = {'executable_path': '/usr/local/bin/chromedriver'}
    browser = Browser('chrome', **executable_path, headless=True)
    browser.visit(url_final[idx])
    html = browser.html
    soup = BeautifulSoup(html, 'html.parser')
    title = soup.find('h2',class_='title').text
    picture = soup.li.a['href']
    mars_hemisphere.append({'title':title,'img_url':picture})
mars_hemisphere<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.14859154929577464, 'fraction_numerical': 0.009507042253521126, 'mean_word_length': 7.5830815709969785, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 21, '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': '586621', 'license': 'ADSL', 'n_tokens_mistral': 1096, 'n_tokens_neox': 1062, 'n_words': 121, 'path': 'mission_to_mars.ipynb', 'repo_name': 'ekohn13/web-scraping-challenge', 'size': '2840'}