-4

I failed to extract the first column "Name" from the website. Is there anyone who can help? Website Screenshot The website address is: https://www.wilsonship.no/our-fleet/fleetlist Many thanks

from scrapy import Selector
import requests

url = 'https://www.wilsonship.no/our-fleet/fleetlist'
html = requests.get(url).content
sel = Selector(text = html)
shipname = sel.xpath('//tr/td[1]/a/text()').extract()
shipname

BurgerQueen
  • 29
  • 1
  • 6
  • The data is generated with JavaScript so you need to get around it. Did you read scrapy's [doc](https://docs.scrapy.org/en/latest/)? Why don't you create a spider? BTW, you didn't accept any answers for your previous questions. – SuperUser Dec 15 '21 at 19:52

1 Answers1

0

It most likely dynamically writes the data using JavaScript. You could use libraries like Selenium or Dryscape to get the data.

You might want to look into Web Scraping JavaScritp page with Python. Or, if you insist on using scrapy, look into Selecting dynamically-loaded content.

NanoPixel
  • 122
  • 8