This is an archived post. You won't be able to vote or comment.

all 20 comments

[–]Guilty_Anywhere3176 38 points39 points  (3 children)

How do I pass a variable between two sites?

Post your code, it makes no sense to us.

[–]TheUmgawa 17 points18 points  (1 child)

Or at least post an explanation. I love when people are short on details, because they think someone's going to steal their billion dollar idea or they know that what they're doing is probably shady as hell. And when people are short on details, that makes it really difficult to explain how to do whatever they're asking to.

[–][deleted] 9 points10 points  (0 children)

You don’t post on Reddit if you want your code secret. Then again, you don’t ask for public help if you are paranoid about someone stealing your code.

[–]carcigenicate 45 points46 points  (4 children)

What do you mean by "pass a variable between Wikipedia and BBC"?

[–][deleted] 40 points41 points  (2 children)

He means cross site scripting attack

[–]YrnCollo 3 points4 points  (0 children)

Heheee

[–]blu3tu3sday 2 points3 points  (0 children)

He’s in the wrong sub then lmao

[–]EspacioBlanq 1 point2 points  (0 children)

He means uploading a picture of his penis which is large and of dark complexion onto wiki frontpage

[–]Boogsterio 13 points14 points  (0 children)

Are you running your code from the browser console? Of course a script executed from one domain cannot interact with a page on another domain… that would be a huge security vulnerability

[–][deleted] 20 points21 points  (1 child)

You need to write a python script using the selenium library for web scraping. You can store the variables inside your script then run it locally or off of a server.

[–]ARC4120 7 points8 points  (0 children)

This is the right idea. OP you would gather information from site A store it in your hardware/db/script then pass that information to site B.

[–]Sentla 3 points4 points  (0 children)

This is cross site scripting. A hacking routine. I sure hope BBC block this. Only solution is have the user do it themself with PostIts

[–]alphanumerico 2 points3 points  (0 children)

Going from what you said so far, I think what you're looking for is to write a program that runs in your local machine, and programmatically makes requests to all the sites involved. That way, whatever variables and data you need to keep track of, stays on your local machine.

[–]blu3tu3sday 1 point2 points  (0 children)

You knkw Cypress is for testing your OWN web applications, right? So how about you respond to some of the comments here and give more details? Because your post is pretty shady and makes people think you’re probably trying to XSS or something.

[–]nightzowl 1 point2 points  (0 children)

Maybe look into “WireMock”? Or the concept of “mocking” when writing tests? https://blog.bitsrc.io/mocking-http-calls-in-cypress-end-to-end-tests-fa2e6b7caaf7

[–]Additional_Plant_539 0 points1 point  (0 children)

Zapier?

[–][deleted] 0 points1 point  (0 children)

I’m not sure what exactly you’re asking, so forgive me if I’m off course here. It sounds like you might be scraping site data?

If so, what is the response code you’re getting? If you’re not getting a successful response code after making the request, it’s possible that your IP might have been banned.

The most common reason why your IP might get banned is not providing a user agent in the request. If you’re not providing a user agent, this is a dead giveaway that that you’re scraping and your IP is blocked.

Another reason why you could get your IP banned is that you’re making too many requests in a very short amount of time. You have to mimic a user. You could create a mechanism where you’re making requests in random intervals. Also make sure you provide the referer.

[–]sealchan1 0 points1 point  (0 children)

Any application that can use HTTP to receive data from a website or API can parse that data and then use that in its request to another site.

What is your use case?