<jupyter_start><jupyter_text>Mars latest news title and news paragrah<jupyter_code>#visit url
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": "chromedriver.exe"}
browser = Browser("chrome", **executable_path, headless=False)
browser.visit(url)
# Scrape page into Soup
html = browser.html
soup = BeautifulSoup(html, "html.parser")
#Find the latest news title and news paragraph
mars_info = {}
mars_info["news_title"]= soup.find("div", class_="bottom_gradient").get_text()
mars_info["news_p"] = soup.find("div", class_="article_teaser_body").get_text()

print(mars_info["news_title"])
print(mars_info["news_p"])<jupyter_output>MOXIE Could Help Future Rockets Launch Off Mars
NASA's Perseverance rover carries a device to convert Martian air into oxygen that, if produced on a larger scale, could be used not just for breathing, but also for fuel.<jupyter_text>Featured Mars Image<jupyter_code># Visit url
featured_image_url = "https://www.jpl.nasa.gov/spaceimages/?search=&category=Mars"
executable_path = {"executable_path": "chromedriver.exe"}
browser = Browser("chrome", **executable_path, headless=False)
browser.visit(featured_image_url)
# Scrape page into Soup
html = browser.html
soup = BeautifulSoup(html, "html.parser")
#get url link
mars_info["image"] = 'https://www.jpl.nasa.gov' + (soup.find_all('div', class_='carousel_items')[0].a.get('data-fancybox-href'))

print (mars_info["image"])<jupyter_output>https://www.jpl.nasa.gov/spaceimages/images/mediumsize/PIA19092_ip.jpg<jupyter_text>Scraping with Pandas - Mars Facts<jupyter_code>#import dependencies
import pandas as pd
#get url line
url = 'https://space-facts.com/mars/'
#read the url
tables = pd.read_html(url)
tables
#get only the first table in the url
df = tables[0]
#set columns name
df.columns = ['Description','Mars']
#set index
df.set_index('Description', inplace = True)

df.style.set_properties(subset=["Description", "Mars"], **{'text-align': 'left'})

#display dataframe
df<jupyter_output><empty_output><jupyter_text>Mars Hemispheres Images and Titles<jupyter_code>#visit url
hemisphere_url= "https://astrogeology.usgs.gov/search/results?q=hemisphere+enhanced&k1=target&v1=Mars"
executable_path = {"executable_path": "chromedriver.exe"}
browser = Browser("chrome", **executable_path, headless=False)
browser.visit(hemisphere_url)
# Scrape page into Soup
html = browser.html
soup = BeautifulSoup(html, "html.parser")
#images
hemiphere = soup.find_all('img',attrs={'class':'thumb'})
hemiphere_img =[]

for img in hemiphere:
    title = img.attrs['alt']
    url = 'https://astrogeology.usgs.gov' + img.attrs['src']
    hemiphere_img.append({'title':title,'img_url':url})

hemiphere_img<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.14573041637261822, 'fraction_numerical': 0.009527170077628794, 'mean_word_length': 7.669724770642202, 'pattern_counts': {'":': 3, '<': 15, '<?xml version=': 0, '>': 15, 'https://': 7, 'lorem ipsum': 0, 'www.': 3, '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': '4', 'dir': 'jupyter-structured-clean-dedup', 'id': '581215', 'license': 'ADSL', 'n_tokens_mistral': 1045, 'n_tokens_neox': 1004, 'n_words': 199, 'path': 'mission_to_mars.ipynb', 'repo_name': 'SandraTeh/web-scraping-challenge', 'size': '2834'}