Question: I am a developer and I work for a start up. My boss assigned me a task of checking two career-related networking sites. I need to programmatically visit these sites, and check whether they have a link for each entity in our database or not. If yes, I need to save their link to our database. The task description he wrote contained some strange wording that raised my suspicion. I learned that the companies in question not only did not give their consent to be queried, but also they already turned our approach down. I am within my probationary period, generally I liked the job. I had some interesting and completely OK tasks in the recent months only this last assignment seems to be fishy. I am not a lawyer. I work and live in a foreign country and I have limited knowledge of the language. It would be extremely hard for me to research whether it is legally OK, or not. We -as a company- have no legal department (As a matter of fact I never worked for any company that had one.). What I do have is a general bad feeling. I believe in business relationships based on **mutual consent** (and mutual benefit) and the lack thereof compromises my moral compass and grossly reduces my enthusiasm. 

The bottom line: I do not want to do anything that may later fall back on me. Nor do I want to act unethically. How can I handle this situation? 

Update:

> 
> So you're just scraping third-party sites? Is the scraped data just
>  used internally, or is it incorporated into one of your products? Is
>  the data private/behind a login screen?
> 
> 
> 

Yes, the scraped data will be incorporated into our product, and will be visible online. 

Is the data private/behind a login screen? I think available without logging in, but I am not sure.

Update: I just had a conversation with my boss, and I politely refused the task. We agreed that I leave the company.

Answer: 
**Have you asked your employer's legal department?** This sort of question is ***exactly*** why they are there; they can look at all the details and give you an expert opinion, and if the answer is "don't" they are in a position to argue this with your boss. 

We don't (and probsbly shouldn't) have all the details, can't give you legal advice, and have no sway with your boss.
Querying public accessible data from websites is most probably no big deal from a legal perspective (but don't nail me on that, I am no lawyer nor do I work in the internet business). 

More general advise would be to document the task description he gave you. As I understood it is already in writing. If the queried companies start legal actions against your employer you can point at the task description and say "hey, I only followed orders!". But as stated in the comments, liability may vary between countries. 

You are of course not protected if you act in gross negligence or deliberately break the law. But I don't see that this would apply here. 

I suspect you are overthinking this. Of course you can act brave and refuse to do the task. But this could result in them firing you. All boils down to a personal decision. If you feel strong enough about the whole topic. The best course of action would be to talk to your boss about it (you already did, that's good). If he insists, you also can talk to your legal department if you have one (I suspect not).