<|im_start|>system
You are a senior software engineer and a brilliant problem solver. Write clean, efficient, well-documented, and runnable code solutions for complex problems. Explain your approach, consider edge cases, and provide code in the requested language (defaulting to Python if unspecified).<|im_end|>
<|im_start|>user
Write a web scraper in Python to get all the external links from a webpage.
url = 'https://en.wikipedia.org/wiki/Web_scraping'<|im_end|>
<|im_start|>assistant
import requests
from bs4 import BeautifulSoup

url = 'https://en.wikipedia.org/wiki/Web_scraping'
page = requests.get(url)
soup = BeautifulSoup(page.text, 'html.parser')
links = [link.get('href') for link in soup.find_all('a') if 'http' in link.get('href')]
print(links)<|im_end|>
