none
With some specific url Web.Content doesn't work RRS feed

  • Question

  • Hello,

    can someone please explain why only with some URLs like the following, Web.Content function does not work while Web.Browsercontent function do?

    A couple of examples:
    https://it.investing.com/etfs/lyxor-stoxx-euro-600-fin.-ser.?cid=47178
    https://it.investing.com/etfs/lyxor-stoxx-euro-600-cons.---mat.?cid=47194

    Is it because of special characters like "-" and "."? And if so, is there a workaround?

    Thanks, Franco

    Monday, January 27, 2020 10:05 AM

Answers

  • Hi Franco,

    Unfortunately there doesn't seem to be a workaround for Excel at this time. Your only option would be to somehow encode the URLs differently in order to avoid this .NET bug, or to use Power BI Desktop instead.

    Ehren

    Tuesday, February 4, 2020 5:56 PM
    Owner

All replies

  • This looks like an old bug in the .NET framework. It's URL parser seems to drop the period just before the question mark. You can reproduce the problem more directly by invoking

    Uri.Parts("https://it.investing.com/etfs/lyxor-stoxx-euro-600-fin.-ser.?cid=47178")

    Note that in Power BI Desktop this produces the correct value, while in Excel the value of the "Path" field is incorrect and is missing the trailing period. This is because Power BI Desktop is setting a value for the .NET Framework of 4.5 while Excel is loading the .NET Framework in a way which sets a compatibility level of .NET 4.0 even though you probably have 4.5 or greater installed.

    The only way this problem can be fixed is if Excel loads .NET differently.

    Monday, January 27, 2020 8:17 PM
  • Hello,

    thanks for the reply, I have .Net Framework 4.7.2 installed. What should I have to do to solve the issue?

    Monday, January 27, 2020 8:36 PM
  • Hi Franco,

    Unfortunately there doesn't seem to be a workaround for Excel at this time. Your only option would be to somehow encode the URLs differently in order to avoid this .NET bug, or to use Power BI Desktop instead.

    Ehren

    Tuesday, February 4, 2020 5:56 PM
    Owner
  • Thanks Ehren, I guessed it. I will use Power BI.

    Franco

    Tuesday, February 4, 2020 6:40 PM