I'm trying to use Python's requests module to access a website, but I keep getting redirected to a different page. I'm new to this, so I have no idea where to begin with fixing the problem.
My code is :
import requests
r = requests.get('https://swiftlink.enbridge.com/portal/')
print r.text
However, instead of printing the text on that page, I get an output starting with:
<html lang="en-US"><head><script>
/*
** Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved.
*/
/**
* This is the loopback script to process the url before the real page loads. It introduces
* a separate round trip. During this first roundtrip, we currently do two things:
* - check the url hash portion, this is for the PPR Navigation.
* - do the new window detection
* the above two are both controled by parameters in web.xml
*
* Since it's very lightweight, so the network latency is the only impact.
*
* here are the list of will-pass-in parameters (these will replace the param in this whole
* pattern:
* viewIdLength view Id length (characters),
* loopbackIdParam loopback Id param name,
* loopbackId loopback Id,
* loopbackIdParamMatchExpr loopback Id match expression,
* windowModeIdParam window mode param name,
* windowModeParamMatchExpr window mode match expression,
* clientWindowIdParam client window Id param name,
* clientWindowIdParamMatchExpr client window Id match expression,
* windowId window Id,
* initPageLaunch initPageLaunch,
* enableNewWindowDetect whether we want to enable new window detection
* jsessionId session Id that needs to be appended to the redirect URL
* enablePPRNav whether we want to enable PPR Navigation
*
*/
After a bit of Googling, I found out that I'm getting redirected to an Oracle ADF loopback script page, but I haven't been able to find ways to get around it. I've tried prohibiting redirects in my code, but that just leads me to pages stating that the page I'm looking for has been moved temporarily. I know that the url I'm using is valid, since it takes me to the right page.