0

Problem Is Quite Simple; I'm using selenium (specifically the PhantomJS Webdriver) to access a website with the URL domain.com/something/⑧.txt for example. Quite straightforward apart from the fact the URL contains the character.

Selenium just changes this to a ? causing the website to return a not found error. Note I'm just using the driver.get function.

This is both annoying and confusing, is there anyway to bypass selenium changing the URL without my permission.

Shawn Mehan
  • 4,513
  • 9
  • 31
  • 51
Mohsin Kale
  • 197
  • 2
  • 11
  • One simple way that I can think of is to just use a URL shortener like [this](https://goo.gl/). This will give your website an alias. – Adeel Ahmad Jun 20 '17 at 16:42
  • interesting, But is there some sort of API or library or programmatic way I can do that; you know without an open website. – Mohsin Kale Jun 20 '17 at 16:44
  • Code please. Please see [mcve]. Python 2 or 3? How are you inputting the symbol? – Alastair McCormack Jun 20 '17 at 16:46
  • @MohsinKale You would only need to shorten the URL only once, no? So, either you can embed the shortened URL in your file or use their [API](https://developers.google.com/api-client-library/python/apis/urlshortener/v1) to retrieve the information. – Adeel Ahmad Jun 20 '17 at 16:49
  • I didnt include any code because literally all I did was driver.get('url'), seemed kinda pointless; I've tried entering the url several ways and I can assure you the character was there before I passed it to selenium, but afterwards it became a '?'. – Mohsin Kale Jun 20 '17 at 16:54
  • @AdeelAhmad Sure, The API Looks nice so I'll go with it, But I'd still prefer a less convoluted way just to access a single url. – Mohsin Kale Jun 20 '17 at 16:56

0 Answers0