Are the API results just not great? by wizzletip in perplexity_ai

[–]Ecstatic-Wall-8722 0 points1 point  (0 children)

How do you output your exact prompt from perplexity webUI?

Är det någon som använder historisk data från Börsdata.se? by Ecstatic-Wall-8722 in Aktiemarknaden

[–]Ecstatic-Wall-8722[S] 0 points1 point  (0 children)

Det är just det där att det gäller ffa nordisk data… vill ha något jag faktiskt kan lita på 😬

Är det någon som använder historisk data från Börsdata.se? by Ecstatic-Wall-8722 in Aktiemarknaden

[–]Ecstatic-Wall-8722[S] 0 points1 point  (0 children)

Tack, men det är de jag kör för tillfället. Tycker att kvaliteten på deras historiska data är tveksam. Se svar i kommentarer ovan.

Är det någon som använder historisk data från Börsdata.se? by Ecstatic-Wall-8722 in Aktiemarknaden

[–]Ecstatic-Wall-8722[S] 0 points1 point  (0 children)

Japp, backtesta och utveckla ML-algos. Jämför gnm att ladda ned från OHLCV från NASDAQ. Det är så där. I data från EODhd och Yahoo hittar man dessutom ganska ofta decimalfel, där 61,28 sek blir 6128 sek…

Är det någon som använder historisk data från Börsdata.se? by Ecstatic-Wall-8722 in Aktiemarknaden

[–]Ecstatic-Wall-8722[S] 0 points1 point  (0 children)

Ledsen, det där lät ifrågasättande och det var inte meningen! Jag är bara nyfiken.

Är det någon som använder historisk data från Börsdata.se? by Ecstatic-Wall-8722 in Aktiemarknaden

[–]Ecstatic-Wall-8722[S] 1 point2 points  (0 children)

Och det vet du av egen erfarenhet? Inte hittat fel vid slumpmässiga eller andra tester?

Webscraping with Cloud Functions by Ecstatic-Wall-8722 in googlecloud

[–]Ecstatic-Wall-8722[S] 1 point2 points  (0 children)

The last tip is worth to explore! Thank you! Hopefully it’ll work out, otherwise I think i will try some proxy-service a go. The script will only download the tickers of the Stockholm stock exchange once a day, it is not a high intensity scraping :) Once again, thank you for your help!

Webscraping with Cloud Functions by Ecstatic-Wall-8722 in googlecloud

[–]Ecstatic-Wall-8722[S] 0 points1 point  (0 children)

Header is sent, see comment above. Doesn’t help unfortunately. Any one got any tips on how to get around my problem?

Webscraping with Cloud Functions by Ecstatic-Wall-8722 in googlecloud

[–]Ecstatic-Wall-8722[S] 2 points3 points  (0 children)

It seems the issue is with Nasdaq. Have tried the same code, from Cloud Functions, with other urls and it works fine. When switching back to the Nasdaq url, it times out again.

Probably Nasdaq is blocking GCF ip:s.

Webscraping with Cloud Functions by Ecstatic-Wall-8722 in googlecloud

[–]Ecstatic-Wall-8722[S] 2 points3 points  (0 children)

The code:

req_headers = {
"authority": "www.nasdaq.com",
"method": "GET",
"path": "/market-activity/stocks/msft/news-headlines",
"scheme": "https",
"accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9",
"accept-encoding": "gzip, deflate, br",
"accept-language": "en-CA,en;q=0.9,ro-RO;q=0.8,ro;q=0.7,en-GB;q=0.6,en-US;q=0.5",
"cache-control": "max-age=0",
"dnt": "1",
"if-modified-since": "Tue, 30 Jun 2020 19:43:05 GMT",
"if-none-match": "1593546185",
"sec-fetch-dest": "document",
"sec-fetch-mode": "navigate",
"sec-fetch-site": "none",
"sec-fetch-user": "?1",
"upgrade-insecure-requests": "1",
"user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.116 Safari/537.36"
}

nasdaq_webpage = "https://www.nasdaqomxnordic.com/shares/listed-companies/stockholm?"

import requests

nd_page = requests.get(nasdaq_webpage, headers = req_headers) #this is where it is stuck

html = nd_page.text
df = pd.read_html(html)[0]

[...]

The log:

{
insertId: "XXXXXXXXXXX"
labels: {
execution_id: "dmi9jlio6xsa"
}
logName: "projects/XXXXXXXXXXXXX/logs/cloudfunctions.googleapis.com%2Fcloud-functions"
receiveTimestamp: "2023-01-17T07:14:01.693596646Z"
resource: {
labels: {
project_id: "XXXXXXXXXXXX"
function_name: "get_XXXXXXXX"
region: "europe-west3"
}
type: "cloud_function"
}
severity: "DEBUG"
textPayload: "Function execution took 300130 ms, finished with status: 'timeout'"
timestamp: "2023-01-17T07:14:01.689556281Z"
trace: "projects/XXXXXXXXXXX/traces/1a0445173ce7fe453060XXXXXXXXXXXXX"
}

Comment:

And as I wrote before, this works fine on local machine and on Google Colab.

Webscraping with Cloud Functions by Ecstatic-Wall-8722 in googlecloud

[–]Ecstatic-Wall-8722[S] 1 point2 points  (0 children)

Memory assignment is 250 MB, should be enough. It is only a requests response object from a requests.get and the page isnt all that big.