Skip to content
Advertisement

Tag: web-scraping

Replacing characters in Scrapy item

I’m trying to scrape from a commerce website using Scrapy. For the price tag, I want to remove the “$”, but my current code does not work. What is the appropriate method to remove characters when using Scrapy? Answer extract() would return you a list, you can use extract_first() to get a single value: Or, you can use the .re()

Getting ‘wrong’ page source when calling url from python

Trying to retrieve the page source from a website, I get a completely different (and shorter) text than when viewing the same page source through a web browser. https://stackoverflow.com/questions/24563601/python-getting-a-wrong-source-code-of-the-web-page-asp-net This fellow has a related issue, but obtained the home page source instead of the requested one – I am getting something completely alien. The code is: This is the page

Web scraping a text() in python

I am having trouble with a web scraping function. The XPath for the two things I am trying to get are The html is I am trying to have a function to loop through each li in tr[5]. The problem I am having is getting the text(). I have tried a number of different variations of this function This specific

Walmart Price Scraping with Python 3

I am very new to this concept, but I am trying to learn how to use python to manipulate HTML data. I wrote a python (ver. 3.4.1) script which fetches the URL and returns some information, which I parse using BeautifulSoup (ver. 4). In this example, I am attempting to obtain the price of the Xbox One. I chose this

Advertisement